How can I finish all the activity/screen in Flutter.
I want it for Android and iOS.
Is there any way to same like finishAffinity() in Android we do.
Example:
A -> B -> C -> D -> Force Logout -> Open Login Screen and close all previous screen.
you can use this:
Navigator.pushAndRemoveUntil(context, yourRouteToLogin, (route) => false);
or if you have named routes:
Navigator.pushNamedAndRemoveUntil( context, yourRouteName, (Route<dynamic> route) => false);
2.1m questions
2.1m answers
60 comments
57.0k users