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
Jonny Borges
2021-07-21 23:12:17 -0300
Browse Files
Options
Browse Files
Download
Plain Diff
Committed by
GitHub
2021-07-21 23:12:17 -0300
Commit
fa753ee46ad635fc531fd842eda125f89e4f1c4f
fa753ee4
2 parents
64fe06b2
2e4d2176
Merge pull request #1667 from jonataslaw/router-fix
fix router outlet
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
CHANGELOG.md
example_nav2/lib/app/modules/root/views/root_view.dart
lib/get_navigation/src/nav2/router_outlet.dart
CHANGELOG.md
View file @
fa753ee
##
[
4.2.4
]
-
Added anchorRoute and filterPages to
// anchorRoute: '/',
// filterPages:
## [4.2.4]
-
Fix Get.offAll removing GetxServices from memory
...
...
example_nav2/lib/app/modules/root/views/root_view.dart
View file @
fa753ee
...
...
@@ -20,9 +20,9 @@ class RootView extends GetView<RootController> {
body:
GetRouterOutlet
(
initialRoute:
Routes
.
HOME
,
// anchorRoute: '/',
filterPages:
(
afterAnchor
)
{
return
afterAnchor
.
take
(
1
);
},
// filterPages: (afterAnchor) {
// return afterAnchor.take(1);
// },
),
);
},
...
...
lib/get_navigation/src/nav2/router_outlet.dart
View file @
fa753ee
...
...
@@ -85,16 +85,14 @@ class GetRouterOutlet extends RouterOutlet<GetDelegate, GetNavConfig> {
pickPages:
(
config
)
{
Iterable
<
GetPage
<
dynamic
>>
ret
;
if
(
anchorRoute
==
null
)
{
//anchorRoute = initialRoute minus last segment
final
parsedUri
=
Uri
.
parse
(
initialRoute
);
final
replacedUri
=
parsedUri
.
replace
(
pathSegments:
parsedUri
.
pathSegments
.
take
(
parsedUri
.
pathSegments
.
length
-
1
,
),
);
anchorRoute
=
'/
$replacedUri
'
;
// jump the ancestor path
final
length
=
Uri
.
parse
(
initialRoute
).
pathSegments
.
length
;
return
config
.
currentTreeBranch
.
skip
(
length
)
.
take
(
length
)
.
toList
();
}
ret
=
config
.
currentTreeBranch
.
pickAfterRoute
(
anchorRoute
!
);
ret
=
config
.
currentTreeBranch
.
pickAfterRoute
(
anchorRoute
);
if
(
filterPages
!=
null
)
{
ret
=
filterPages
(
ret
);
}
...
...
Please
register
or
login
to post a comment