Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
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
1
Merge Requests
1
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_boost_1.22.4
Commits
12b52d25
Commit
12b52d25
authored
Dec 03, 2020
by
尘萧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复切换页面滑动失效的问题
parent
12ffd101
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
lib/container/boost_container.dart
lib/container/boost_container.dart
+34
-0
No files found.
lib/container/boost_container.dart
View file @
12b52d25
...
@@ -118,6 +118,8 @@ class BoostContainer extends Navigator {
...
@@ -118,6 +118,8 @@ class BoostContainer extends Navigator {
class
BoostContainerState
extends
NavigatorState
{
class
BoostContainerState
extends
NavigatorState
{
VoidCallback
backPressedHandler
;
VoidCallback
backPressedHandler
;
VoidCallback
lifeCycleObserverRemove
;
String
get
uniqueId
=>
widget
.
settings
.
uniqueId
;
String
get
uniqueId
=>
widget
.
settings
.
uniqueId
;
String
get
name
=>
widget
.
settings
.
name
;
String
get
name
=>
widget
.
settings
.
name
;
...
@@ -135,6 +137,8 @@ class BoostContainerState extends NavigatorState {
...
@@ -135,6 +137,8 @@ class BoostContainerState extends NavigatorState {
@override
@override
BoostContainer
get
widget
=>
super
.
widget
as
BoostContainer
;
BoostContainer
get
widget
=>
super
.
widget
as
BoostContainer
;
final
Set
<
int
>
_activePointers
=
<
int
>{};
List
<
Route
<
dynamic
>>
routerHistory
=
<
Route
<
dynamic
>>[];
List
<
Route
<
dynamic
>>
routerHistory
=
<
Route
<
dynamic
>>[];
bool
multipleRouteMode
=
false
;
bool
multipleRouteMode
=
false
;
...
@@ -154,6 +158,12 @@ class BoostContainerState extends NavigatorState {
...
@@ -154,6 +158,12 @@ class BoostContainerState extends NavigatorState {
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
backPressedHandler
=
()
=>
maybePop
();
backPressedHandler
=
()
=>
maybePop
();
lifeCycleObserverRemove
=
addLifeCycleObserver
(
(
ContainerLifeCycle
state
,
BoostContainerSettings
settings
)
{
if
(
state
==
ContainerLifeCycle
.
Disappear
){
_cancelActivePointers
();
}
});
}
}
@override
@override
...
@@ -167,6 +177,8 @@ class BoostContainerState extends NavigatorState {
...
@@ -167,6 +177,8 @@ class BoostContainerState extends NavigatorState {
GlobalRouteSettingsManager
.
instance
.
removeSettings
(
route
);
GlobalRouteSettingsManager
.
instance
.
removeSettings
(
route
);
}
}
lifeCycleObserverRemove
();
routerHistory
.
clear
();
routerHistory
.
clear
();
super
.
dispose
();
super
.
dispose
();
...
@@ -259,6 +271,28 @@ class BoostContainerState extends NavigatorState {
...
@@ -259,6 +271,28 @@ class BoostContainerState extends NavigatorState {
return
future
;
return
future
;
}
}
@override
Widget
build
(
BuildContext
context
)
{
return
Listener
(
onPointerDown:
_handlePointerDown
,
onPointerUp:
_handlePointerUpOrCancel
,
onPointerCancel:
_handlePointerUpOrCancel
,
child:
super
.
build
(
context
),
);
}
void
_handlePointerDown
(
PointerDownEvent
event
)
{
_activePointers
.
add
(
event
.
pointer
);
}
void
_handlePointerUpOrCancel
(
PointerEvent
event
)
{
_activePointers
.
remove
(
event
.
pointer
);
}
void
_cancelActivePointers
()
{
_activePointers
.
toList
().
forEach
(
WidgetsBinding
.
instance
.
cancelPointer
);
}
VoidCallback
addLifeCycleObserver
(
BoostContainerLifeCycleObserver
observer
)
{
VoidCallback
addLifeCycleObserver
(
BoostContainerLifeCycleObserver
observer
)
{
return
FlutterBoost
.
singleton
.
addBoostContainerLifeCycleObserver
(
return
FlutterBoost
.
singleton
.
addBoostContainerLifeCycleObserver
(
(
ContainerLifeCycle
state
,
BoostContainerSettings
settings
)
{
(
ContainerLifeCycle
state
,
BoostContainerSettings
settings
)
{
...
...
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