Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
common_module
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
flutter-plugin
common_module
Commits
9304853e
Commit
9304853e
authored
Oct 15, 2021
by
汪林玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
0cb95f74
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
204 additions
and
284 deletions
+204
-284
lib/base/base_page_view_item_state.dart
lib/base/base_page_view_item_state.dart
+2
-2
lib/base/base_tab_bar_view_item_state.dart
lib/base/base_tab_bar_view_item_state.dart
+3
-6
lib/components/i_nested_scroll_view.dart
lib/components/i_nested_scroll_view.dart
+3
-18
lib/utils/permission_utils.dart
lib/utils/permission_utils.dart
+2
-2
lib/utils/store_utils.dart
lib/utils/store_utils.dart
+6
-6
lib/widget/pull_widget/widget.dart
lib/widget/pull_widget/widget.dart
+1
-2
pubspec.lock
pubspec.lock
+185
-246
pubspec.yaml
pubspec.yaml
+2
-2
No files found.
lib/base/base_page_view_item_state.dart
View file @
9304853e
...
...
@@ -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
;
}
}
...
...
lib/base/base_tab_bar_view_item_state.dart
View file @
9304853e
...
...
@@ -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
();
}
...
...
lib/components/i_nested_scroll_view.dart
View file @
9304853e
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
.
Extended
NestedScrollView
(
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
];
}),
);
}
...
...
lib/utils/permission_utils.dart
View file @
9304853e
...
...
@@ -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
.
undetermin
ed
)
{
if
(
status
==
PermissionStatus
.
deni
ed
)
{
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
.
undetermin
ed
)
{
if
(
status
==
PermissionStatus
.
deni
ed
)
{
resultPermissions
[
permission
]
=
PermissionUtilsStatus
.
denied
;
}
else
if
(
status
==
PermissionStatus
.
denied
)
{
if
(
Platform
.
isIOS
)
{
...
...
lib/utils/store_utils.dart
View file @
9304853e
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;
}
}
*/
///
/// 获取缓存的文件夹
...
...
lib/widget/pull_widget/widget.dart
View file @
9304853e
...
...
@@ -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
,
...
...
pubspec.lock
View file @
9304853e
This diff is collapsed.
Click to expand it.
pubspec.yaml
View file @
9304853e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment