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()),
);
You can use Navigator.push(context) for navigate from one page another using button, like the following:
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ScreenDashboard(),
),
);
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With