Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ahmed Fwela
2021-07-19 11:45:58 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e330038c4c9c7e9b446e2c30506afbbf71748b92
e330038c
1 parent
aefbfe55
+ rolled back participatesInRootNavigator
+ made GetNavigator key optional
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
example_nav2/lib/app/routes/app_pages.dart
lib/get_navigation/src/nav2/get_router_delegate.dart
lib/get_navigation/src/nav2/router_outlet.dart
lib/get_navigation/src/routes/get_route.dart
example_nav2/lib/app/routes/app_pages.dart
View file @
e330038
...
...
@@ -36,13 +36,11 @@ class AppPages {
//only enter this route when not authed
EnsureNotAuthedMiddleware
(),
],
participatesInRootNavigator:
false
,
name:
_Paths
.
LOGIN
,
page:
()
=>
LoginView
(),
binding:
LoginBinding
(),
),
GetPage
(
participatesInRootNavigator:
false
,
preventDuplicates:
true
,
name:
_Paths
.
HOME
,
page:
()
=>
HomeView
(),
...
...
@@ -83,7 +81,6 @@ class AppPages {
],
),
GetPage
(
participatesInRootNavigator:
true
,
name:
_Paths
.
SETTINGS
,
page:
()
=>
SettingsView
(),
binding:
SettingsBinding
(),
...
...
lib/get_navigation/src/nav2/get_router_delegate.dart
View file @
e330038
...
...
@@ -263,7 +263,7 @@ class GetDelegate extends RouterDelegate<GetNavConfig>
if
(
currentHistory
==
null
)
return
<
GetPage
>[];
final
res
=
currentHistory
.
currentTreeBranch
.
where
((
r
)
=>
r
.
participatesInRootNavigator
);
.
where
((
r
)
=>
r
.
participatesInRootNavigator
!=
null
);
if
(
res
.
length
==
0
)
{
//default behavoir, all routes participate in root navigator
return
currentHistory
.
currentTreeBranch
;
...
...
@@ -421,10 +421,13 @@ class GetNavigator extends Navigator {
bool
reportsRouteUpdateToEngine
=
false
,
TransitionDelegate
?
transitionDelegate
,
String
?
name
,
})
:
assert
(
key
!=
null
||
name
!=
null
,
'GetNavigator should either have a key or a name set'
),
super
(
key:
key
??
Get
.
nestedKey
(
name
),
})
:
super
(
//keys should be optional
key:
key
!=
null
?
key
:
name
!=
null
?
Get
.
nestedKey
(
name
)
:
null
,
onPopPage:
onPopPage
??
(
route
,
result
)
{
final
didPop
=
route
.
didPop
(
result
);
...
...
lib/get_navigation/src/nav2/router_outlet.dart
View file @
e330038
...
...
@@ -94,7 +94,7 @@ class GetRouterOutlet extends RouterOutlet<GetDelegate, GetNavConfig> {
GetPage
Function
(
GetDelegate
delegate
)?
emptyPage
,
required
List
<
GetPage
>
Function
(
GetNavConfig
currentNavStack
)
pickPages
,
bool
Function
(
Route
<
dynamic
>,
dynamic
)?
onPopPage
,
required
String
name
,
String
?
name
,
})
:
assert
(
(
emptyPage
==
null
&&
emptyWidget
==
null
)
||
(
emptyPage
!=
null
&&
emptyWidget
==
null
)
||
...
...
lib/get_navigation/src/routes/get_route.dart
View file @
e330038
...
...
@@ -34,7 +34,7 @@ class GetPage<T> extends Page<T> {
final
String
?
title
;
final
Transition
?
transition
;
final
Curve
curve
;
final
bool
participatesInRootNavigator
;
final
bool
?
participatesInRootNavigator
;
final
Alignment
?
alignment
;
final
bool
maintainState
;
final
bool
opaque
;
...
...
@@ -66,7 +66,7 @@ class GetPage<T> extends Page<T> {
required
this
.
name
,
required
this
.
page
,
this
.
title
,
this
.
participatesInRootNavigator
=
true
,
this
.
participatesInRootNavigator
,
this
.
gestureWidth
=
20
,
// RouteSettings settings,
this
.
maintainState
=
true
,
...
...
Please
register
or
login
to post a comment