pushNamedAndRemoveUntil<T extends Object?> method
Pushes a named route onto the navigator and removes all previous routes.
Allows passing arguments to the route. rootNavigator determines whether
to push the route onto the root navigator or the nearest Navigator ancestor.
Returns a Future that completes with the result of the pushed route when it is popped.
Implementation
Future<T?> pushNamedAndRemoveUntil<T extends Object?>(
String routeName, {
Object? arguments,
bool rootNavigator = false,
}) {
return Navigator.of(
this,
rootNavigator: rootNavigator,
).pushNamedAndRemoveUntil(routeName, (Route<dynamic> route) => false,
arguments: arguments);
}