Home > OS >  Navigate routes not recommended for most applications flutter in flutter docs
Navigate routes not recommended for most applications flutter in flutter docs

Time:01-02

I was reading here about navigate with named routes, and in the document itself it says that it is no longer recommended to use it in many applications. Can anyone recommend me what is correct to use now? Or some article talking about.

CodePudding user response:

Flutter docs suggests using go_router package for Navigation.


Explanation:

Limitations of trivial approach

Although named routes can handle deep links, the behavior is always the same and can’t be customized. When a new deep link is received by the platform, Flutter pushes a new Route onto the Navigator regardless where the user currently is.

Suggested Better Approach

Flutter applications with advanced navigation and routing requirements (such as a web app that uses direct links to each screen, or an app with multiple Navigator widgets) should use a routing package such as go_router that can parse the route path and configure the Navigator whenever the app receives a new deep link.


Reference questions regarding go_router:

  • Related