0

I am exploring moving our app to the 'go_router' Flutter package to make use of their Navigator 2.0 functionality.

When initialising the GoRouter with routes, is it standard practice/expected to declare ALL linked/url views here?

For example, I could declare a Home() page route at the root of the app. However, if I have a screen which is 10 pages/routes deep ./home/../../../../../../../../deep-page, would it be standard practice to declare that link and all its parent routes from the get go?

It seems a lot to have so many declerations in the root of the app, so wanted clarity on this is normal/acceptable or if there is a better method.

halfer
  • 19,824
  • 17
  • 99
  • 186
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253
  • I didn't get you, You want to go 10 page deep ?, so yes you have to define 10 page routes in the router upfront to go to 10th child page and You dont have to declare all routes at once, instead you can create them dyanmically whenever you have its need. Correct me if i got you wrong. – krishnaacharyaa Mar 07 '23 at 00:09
  • Yes you understood thank you. What do you mean when you say routes don’t have to be declared at once? I thought PageRoute was that declaration. – Josh Kahane Mar 07 '23 at 00:38

0 Answers0