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-06-03 08:05:14 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1399e561693c4272ed882abd233153532d8fd33a
1399e561
1 parent
7a911cf4
fixed named parameter parsing
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
lib/get_navigation/src/root/parse_route.dart
lib/get_navigation/src/root/parse_route.dart
View file @
1399e56
...
...
@@ -36,30 +36,22 @@ class ParseRouteTree {
}
final
treeBranch
=
cumulativePaths
.
map
(
(
p
)
{
final
res
=
_findRoute
(
p
);
//change GetPage name from the regex to the actual name
return
res
?.
copy
(
name:
p
,
);
},
)
.
where
((
element
)
=>
element
!=
null
)
.
cast
<
GetPage
>()
.
map
((
e
)
=>
MapEntry
(
e
,
_findRoute
(
e
)))
.
where
((
element
)
=>
element
.
value
!=
null
)
.
toList
();
final
params
=
Map
<
String
,
String
>.
from
(
uri
.
queryParameters
);
if
(
treeBranch
.
isNotEmpty
)
{
//route is found, do further parsing to get nested query params
final
lastRoute
=
treeBranch
.
last
;
final
parsedParams
=
_parseParams
(
name
,
lastRoute
.
path
);
final
parsedParams
=
_parseParams
(
name
,
lastRoute
.
value
!.
path
);
if
(
parsedParams
.
isNotEmpty
)
{
params
.
addAll
(
parsedParams
);
}
//copy parameters to all pages.
final
mappedTreeBranch
=
treeBranch
.
map
(
(
e
)
=>
e
.
copy
(
(
e
)
=>
e
.
value
!.
copy
(
parameter:
params
,
),
)
...
...
@@ -72,7 +64,7 @@ class ParseRouteTree {
//route not found
return
RouteDecoder
(
treeBranch
,
treeBranch
.
map
((
e
)
=>
e
.
value
!).
toList
()
,
params
,
);
}
...
...
@@ -132,6 +124,7 @@ class ParseRouteTree {
opaque:
origin
.
opaque
,
parameter:
origin
.
parameter
,
popGesture:
origin
.
popGesture
,
// settings: origin.settings,
transitionDuration:
origin
.
transitionDuration
,
middlewares:
middlewares
,
...
...
Please
register
or
login
to post a comment