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

更新

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