79573329

Date: 2025-04-14 14:10:51
Score: 2
Natty:
Report link

Got a satisfying answer:
I am trying to understand the advantages and disadvantages of named routes vs directly pushing the Widget to Navigator. In the cookbook, I only get information about how to, not why/why not.

In my opinion, pushing Widget directly to Navigator is a better, simpler, and safer option even for a large application.

- You don't need to create a centralized brain that knows everything about the app.

- Passing data is very easy no need to do additional mapping and thanks to required arguments if something changes you can easily identify things needed to be updated.

- Parents know how to instantiate their children.

The only argument I see for named routes is if I consider Flutter for web, where I would like to see something like "/profile/description" in the address bar.

https://www.reddit.com/r/FlutterDev/comments/gei3fb/routes_named_vs_unnamed/?rdt=54144

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Blacklisted phrase (1): I am trying to
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Vishva Vijay