Flutter also doesn’t support the browser forward button for applications using
named routes. For these reasons, we don’t recommend using named routes in most
applications.

Using the Router

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.

To use the Router, switch to the router constructor on MaterialApp or
CupertinoApp and provide it with a Router configuration. Routing packages,
such as go_router, typically provide a
configuration for you. For example:

MaterialApp

router

routerConfig:

GoRouter

// …

);

Because packages like go_router are declarative, they will always display the
same screen(s) when a deep link is received.