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
Eduardo Florence
2020-12-29 21:32:49 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a8c4f21c5b35fd2a89677a99480c2108eb35b05a
a8c4f21c
1 parent
879a4f22
Add Page Parameter
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
lib/get_navigation/src/routes/route_middleware.dart
lib/get_navigation/src/routes/route_middleware.dart
View file @
a8c4f21
...
...
@@ -206,6 +206,7 @@ class PageRedirect {
/// check if redirect is needed
bool
needRecheck
()
{
final
match
=
Get
.
routeTree
.
matchRoute
(
settings
.
name
);
Get
.
parameters
=
match
?.
parameters
;
// No Match found
if
(
match
?.
route
==
null
)
{
...
...
@@ -215,7 +216,7 @@ class PageRedirect {
final
runner
=
MiddlewareRunner
(
match
.
route
.
middlewares
);
route
=
runner
.
runOnPageCalled
(
match
.
route
);
Get
.
parameters
=
route
?.
parameter
;
addPageParameter
(
route
)
;
// No middlewares found return match.
if
(
match
.
route
.
middlewares
==
null
||
match
.
route
.
middlewares
.
isEmpty
)
{
...
...
@@ -228,4 +229,16 @@ class PageRedirect {
settings
=
newSettings
;
return
true
;
}
void
addPageParameter
(
GetPage
route
)
{
if
(
route
.
parameter
==
null
)
return
;
if
(
Get
.
parameters
==
null
)
{
Get
.
parameters
=
route
.
parameter
;
}
else
{
final
parameters
=
Get
.
parameters
;
parameters
.
addEntries
(
route
.
parameter
.
entries
);
Get
.
parameters
=
parameters
;
}
}
}
...
...
Please
register
or
login
to post a comment