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
a02c9808
Commit
a02c9808
authored
3 years ago
by
李增强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m
parent
322db076
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
18 deletions
+28
-18
lib/container/boost_container.dart
lib/container/boost_container.dart
+28
-18
No files found.
lib/container/boost_container.dart
View file @
a02c9808
...
...
@@ -187,12 +187,17 @@ class BoostContainerState extends NavigatorState {
@override
Future
<
bool
>
maybePop
<
T
extends
Object
>([
T
result
])
async
{
if
(
routerHistory
.
isEmpty
){
if
(
routerHistory
.
isEmpty
)
{
var
c
=
FlutterBoost
.
containerManager
.
onstageSettings
;
pop
(
result
);
if
(
c
!=
null
&&
c
.
name
==
'/'
){
FlutterBoost
.
singleton
.
channel
.
sendEvent
(
"go_moble_home"
,
null
);
return
false
;
}
return
true
;
}
final
Route
<
T
>
route
=
routerHistory
.
last
;
final
RoutePopDisposition
disposition
=
await
route
.
willPop
();
if
(
mounted
)
{
...
...
@@ -221,21 +226,23 @@ class BoostContainerState extends NavigatorState {
}
if
(
canPop
())
{
super
.
pop
<
T
>(
result
);
if
(
removedRoute
!=
null
)
{
GlobalRouteSettingsManager
.
instance
.
removeSettings
(
removedRoute
);
}
if
(
Platform
.
isIOS
&&
multipleRouteMode
&&
!
canPop
())
{
FlutterBoost
.
singleton
.
channel
.
invokeMethod
<
dynamic
>(
'enablePopGesture'
,
null
);
//开启native返回手势
}
super
.
pop
<
T
>(
result
);
if
(
removedRoute
!=
null
)
{
GlobalRouteSettingsManager
.
instance
.
removeSettings
(
removedRoute
);
}
if
(
Platform
.
isIOS
&&
multipleRouteMode
&&
!
canPop
())
{
FlutterBoost
.
singleton
.
channel
.
invokeMethod
<
dynamic
>(
'enablePopGesture'
,
null
);
//开启native返回手势
}
}
else
{
if
(
T
is
Map
<
String
,
dynamic
>)
{
FlutterBoost
.
singleton
.
closeInternal
(
uniqueId
,
result:
result
as
Map
<
String
,
dynamic
>);
}
else
{
FlutterBoost
.
singleton
.
closeInternal
(
uniqueId
,);
FlutterBoost
.
singleton
.
closeInternal
(
uniqueId
,
);
}
}
return
true
;
...
...
@@ -250,7 +257,8 @@ class BoostContainerState extends NavigatorState {
}
if
(
multipleRouteMode
&&
routerHistory
.
isNotEmpty
)
{
ContainerNavigatorObserver
.
bindContainerManager
().
willPush
(
route
,
routerHistory
.
last
);
ContainerNavigatorObserver
.
bindContainerManager
()
.
willPush
(
route
,
routerHistory
.
last
);
}
Future
<
T
>
future
=
super
.
push
<
T
>(
newRoute
??
route
);
...
...
@@ -317,13 +325,15 @@ class ContainerNavigatorObserver extends NavigatorObserver {
void
willPush
(
Route
<
dynamic
>
route
,
Route
<
dynamic
>
previousRoute
)
{
for
(
NavigatorObserver
observer
in
boostObservers
)
{
if
(
observer
is
ContainerNavigatorObserver
)
{
if
(
observer
is
ContainerNavigatorObserver
)
{
if
(
observer
==
this
)
continue
;
ContainerNavigatorObserver
containerNavigatorObserver
=
observer
as
ContainerNavigatorObserver
;
ContainerNavigatorObserver
containerNavigatorObserver
=
observer
as
ContainerNavigatorObserver
;
containerNavigatorObserver
.
willPush
(
route
,
previousRoute
);
}
}
}
@override
void
didPush
(
Route
<
dynamic
>
route
,
Route
<
dynamic
>
previousRoute
)
{
for
(
NavigatorObserver
observer
in
boostObservers
)
{
...
...
@@ -358,14 +368,14 @@ class ContainerNavigatorObserver extends NavigatorObserver {
}
class
GlobalRouteSettingsManager
{
GlobalRouteSettingsManager
.
_
();
static
GlobalRouteSettingsManager
instance
=
GlobalRouteSettingsManager
.
_
();
final
Map
<
Route
,
BoostRouteSettings
>
_routeSettingsMap
=
<
Route
,
BoostRouteSettings
>{};
final
Map
<
Route
,
BoostRouteSettings
>
_routeSettingsMap
=
<
Route
,
BoostRouteSettings
>{};
void
addSettings
(
Route
route
,
BoostRouteSettings
settings
)
{
void
addSettings
(
Route
route
,
BoostRouteSettings
settings
)
{
_routeSettingsMap
[
route
]
=
settings
;
}
...
...
This diff is collapsed.
Click to expand it.
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