removeAllAndPush method
Future removeAllAndPush (String routeName, String tillRoute, {dynamic arguments})
This function remove all the routes till the particular route and add new route.
params:
routeName
: route that need to addtillRoute
: remove all route until this route.arguments
: necessary data for the route
Implementation
Future<dynamic> removeAllAndPush(
String routeName,
String tillRoute, {
dynamic arguments,
}) {
return navigatorKey.currentState!.pushNamedAndRemoveUntil(
routeName,
ModalRoute.withName(tillRoute),
arguments: arguments,
);
}