This repository has been archived by the owner on Feb 25, 2022. It is now read-only.
Optional path parameters #327
Unanswered
adamsowinski
asked this question in
Q&A
Replies: 1 comment
-
Path parameters are required. You can use query parameters for optional params. Or you can use redirection, e.g. routes: [
// fill in the default value for topBarIndex
GoRoute(path: '/admin/:bottomBarIndex', redirect: (c,s) => '/admin/${s.params['bottomBarIndex']}/1'),
// now you have both params
GoRoute(path: '/admin/:bottomBarIndex/:topBarIndex', build: (c,s) ...,
] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello I have an admin area of my app that uses a bottom tabbar for navigation. I'm using a nested navigation for it and it works great (route '/admin/:bottomBarIndex/'). On one page I have two tabs that are placed below app bar. What I would like to achive is have a nested navigation route like this '/admin/:bottomBarIndex/:topBarIndex' where topBarIndex parameter would be optional cause it applies only for one bottomBarIndex. How to do it? It seems that with current setup only routes with two parameters are matched so for example: '/admin/2/1' and not '/admin/2'.
Beta Was this translation helpful? Give feedback.
All reactions