I am an android developer and now learning about flutter development. In flutter navigator is using to move one page to another like intents in android. While I am using navigate, the back is goes to the initial page.
Am using the below code for navigation.
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (c) => widget.user ? Dashboard() : Login()),
);
Flutter docs suggests using go_router
package for Navigation.
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.