I am beginner to Flutter.
I have splash screen and I can navigate from splash to login screen, but I can't destroy the splash screen.
I want to finish the splash screen after I navigate to login screen just like below action in android, how can I achieve this in Flutter.
startActivity(new Intent(this, Login.class));
finish();
Thanks.
To navigate from one screen to another, you must use the Navigator .
Dart. SystemNavigator. pop(); We will use the Text Button at to call the Navigator pop method that will end the user screen.
Use MaterialPageRoute to create route to your widget. Then place your route along with context to Navigator. pushReplacement finishes current screen while push creates new widget over it.
Route route = MaterialPageRoute(builder: (context) => YourWidget());
Navigator.pushReplacement(context, route);
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