Commit 9304853e authored by 汪林玲's avatar 汪林玲

更新

parent 0cb95f74
...@@ -103,12 +103,12 @@ abstract class BasePageViewItemState<T extends StatefulWidget> ...@@ -103,12 +103,12 @@ abstract class BasePageViewItemState<T extends StatefulWidget>
position.viewportDimension); position.viewportDimension);
int index = pixels.round(); int index = pixels.round();
var currentWidget = _getTabs()[index]; var currentWidget = _getTabs()[index];
if (currentWidget /*if (currentWidget
is extended.NestedScrollViewInnerScrollPositionKeyWidget) { is extended.NestedScrollViewInnerScrollPositionKeyWidget) {
currentWidget = (currentWidget currentWidget = (currentWidget
as extended.NestedScrollViewInnerScrollPositionKeyWidget) as extended.NestedScrollViewInnerScrollPositionKeyWidget)
.child; .child;
} }*/
return widget == currentWidget; return widget == currentWidget;
} }
} }
......
...@@ -92,13 +92,10 @@ abstract class BaseTabBarViewItemState<T extends StatefulWidget> ...@@ -92,13 +92,10 @@ abstract class BaseTabBarViewItemState<T extends StatefulWidget>
bool isCurrent() { bool isCurrent() {
var currentWidget = _getTabs()[getTabController().index]; var currentWidget = _getTabs()[getTabController().index];
if (currentWidget /*if (currentWidget
is extended.NestedScrollViewInnerScrollPositionKeyWidget) { is extended.NestedScrollViewInnerScrollPositionKeyWidget) {
currentWidget = (currentWidget currentWidget = (currentWidget as extended.NestedScrollViewInnerScrollPositionKeyWidget).child;
as extended.NestedScrollViewInnerScrollPositionKeyWidget) }*/
.child;
}
return widget == currentWidget && isParentCurrent(); return widget == currentWidget && isParentCurrent();
} }
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart' import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart' as extended;
as extended;
import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/gestures.dart' show DragStartBehavior;
typedef NestedScrollViewHeaderSliversBuilder = List<Widget> Function( typedef NestedScrollViewHeaderSliversBuilder = List<Widget> Function(
...@@ -39,7 +38,7 @@ class INestedScrollView extends StatelessWidget { ...@@ -39,7 +38,7 @@ class INestedScrollView extends StatelessWidget {
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return extended.NestedScrollView( return extended.ExtendedNestedScrollView(
controller: controller, controller: controller,
scrollDirection: scrollDirection, scrollDirection: scrollDirection,
reverse: reverse, reverse: reverse,
...@@ -51,21 +50,8 @@ class INestedScrollView extends StatelessWidget { ...@@ -51,21 +50,8 @@ class INestedScrollView extends StatelessWidget {
restorationId: restorationId, restorationId: restorationId,
headerSliverBuilder: headerSliverBuilder, headerSliverBuilder: headerSliverBuilder,
body: body, body: body,
innerScrollPositionKeyBuilder: () {
var index = "i_nested_scroll_view_tab_";
index += (_getTabController(context).index.toString());
return Key(index);
},
); );
} }
TabController _getTabController(BuildContext context) {
if (tabController != null) {
return tabController;
} else {
return DefaultTabController.of(context);
}
}
} }
class INestedTabBarView extends StatelessWidget { class INestedTabBarView extends StatelessWidget {
...@@ -89,8 +75,7 @@ class INestedTabBarView extends StatelessWidget { ...@@ -89,8 +75,7 @@ class INestedTabBarView extends StatelessWidget {
physics: physics, physics: physics,
dragStartBehavior: dragStartBehavior, dragStartBehavior: dragStartBehavior,
children: List.generate(children.length, (index) { children: List.generate(children.length, (index) {
return extended.NestedScrollViewInnerScrollPositionKeyWidget( return children[index];
Key("i_nested_scroll_view_tab_$index"), children[index]);
}), }),
); );
} }
......
...@@ -21,7 +21,7 @@ class PermissionUtils { ...@@ -21,7 +21,7 @@ class PermissionUtils {
for (int i = 0, len = permissions.length; i < len; i++) { for (int i = 0, len = permissions.length; i < len; i++) {
var permission = permissions[i]; var permission = permissions[i];
var status = await permission.status; var status = await permission.status;
if (status == PermissionStatus.undetermined) { if (status == PermissionStatus.denied) {
resultPermissions[permission] = PermissionUtilsStatus.denied; resultPermissions[permission] = PermissionUtilsStatus.denied;
} else if (status == PermissionStatus.denied) { } else if (status == PermissionStatus.denied) {
if (Platform.isIOS) { if (Platform.isIOS) {
...@@ -51,7 +51,7 @@ class PermissionUtils { ...@@ -51,7 +51,7 @@ class PermissionUtils {
for (int i = 0, len = permissions.length; i < len; i++) { for (int i = 0, len = permissions.length; i < len; i++) {
var permission = permissions[i]; var permission = permissions[i];
var status = resultMap[permission]; var status = resultMap[permission];
if (status == PermissionStatus.undetermined) { if (status == PermissionStatus.denied) {
resultPermissions[permission] = PermissionUtilsStatus.denied; resultPermissions[permission] = PermissionUtilsStatus.denied;
} else if (status == PermissionStatus.denied) { } else if (status == PermissionStatus.denied) {
if (Platform.isIOS) { if (Platform.isIOS) {
......
import 'dart:io'; import 'dart:io';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:localstorage/localstorage.dart'; import 'package:localstorage/localstorage.dart';
import 'package:shared_preferences/shared_preferences.dart'; //import 'package:shared_preferences/shared_preferences.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
/// ///
...@@ -9,7 +9,7 @@ import 'package:path_provider/path_provider.dart'; ...@@ -9,7 +9,7 @@ import 'package:path_provider/path_provider.dart';
/// ///
class StoreUtils { class StoreUtils {
/// app全局配置 eg:theme /// app全局配置 eg:theme
SharedPreferences _sharedPreferences; //SharedPreferences _sharedPreferences;
/// 临时目录 eg: cookie /// 临时目录 eg: cookie
Directory _temporaryDirectory; Directory _temporaryDirectory;
...@@ -31,7 +31,7 @@ class StoreUtils { ...@@ -31,7 +31,7 @@ class StoreUtils {
Future<bool> init() async { Future<bool> init() async {
// async 异步操作 // async 异步操作
// sync 同步操作 // sync 同步操作
_sharedPreferences = await SharedPreferences.getInstance(); //_sharedPreferences = await SharedPreferences.getInstance();
_localStorage = LocalStorage('LocalStorage'); _localStorage = LocalStorage('LocalStorage');
_temporaryDirectory = await getTemporaryDirectory(); _temporaryDirectory = await getTemporaryDirectory();
return await _localStorage.ready; return await _localStorage.ready;
...@@ -42,7 +42,7 @@ class StoreUtils { ...@@ -42,7 +42,7 @@ class StoreUtils {
/// [key] 键 /// [key] 键
/// ///
dynamic getForKey({@required String key,dynamic defaultValue}) { dynamic getForKey({@required String key,dynamic defaultValue}) {
return getStorage?.getItem(key)??defaultValue; return getStorage.getItem(key)??defaultValue;
} }
/// ///
...@@ -72,9 +72,9 @@ class StoreUtils { ...@@ -72,9 +72,9 @@ class StoreUtils {
/// ///
/// 获取数据持久化的类 /// 获取数据持久化的类
/// ///
SharedPreferences get getShared { /*SharedPreferences get getShared {
return _sharedPreferences; return _sharedPreferences;
} }*/
/// ///
/// 获取缓存的文件夹 /// 获取缓存的文件夹
......
...@@ -25,8 +25,7 @@ class PullWidget extends StatelessWidget { ...@@ -25,8 +25,7 @@ class PullWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SmartRefresher( return SmartRefresher(
//headerInsertIndex: headerInsertIndex,
headerInsertIndex: headerInsertIndex,
footer: footer, footer: footer,
scrollController: scrollController, scrollController: scrollController,
controller: controller, controller: controller,
......
This diff is collapsed.
...@@ -15,8 +15,8 @@ dependencies: ...@@ -15,8 +15,8 @@ dependencies:
event_bus: ^2.0.0 event_bus: ^2.0.0
url_launcher: ^6.0.12 url_launcher: ^6.0.12
connectivity: ^3.0.6 connectivity: ^3.0.6
localstorage: ^3.0.6 localstorage: ^4.0.0+1
shared_preferences: ^2.0.8 #shared_preferences: ^2.0.8
cached_network_image: ^3.1.0 cached_network_image: ^3.1.0
qr_flutter: ^4.0.0 qr_flutter: ^4.0.0
package_info: ^2.0.2 package_info: ^2.0.2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment