Closed adamsowinski closed 2 years ago
Path parameters are required. You can use query parameters for optional params. Or you can use direction, 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) ...,
]
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'.