Answers for "flutter navigation remove all routes"

1

How to remove all routes in flutter

Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) =>
    LoginScreen()), (Route<dynamic> route) => false),
Posted by: Guest on September-29-2021
1

flutter navigator remove all routes and navigate to a new screen

Navigator.pushAndRemoveUntil<dynamic>(
        context,
        MaterialPageRoute<dynamic>(
          builder: (BuildContext context) => YourPageNameGoesHere(),
        ),
        (route) => false,//if you want to disable back feature set to false
);
Posted by: Guest on March-01-2021

Code answers related to "Dart"

Browse Popular Code Answers by Language