pushReplacementNamed<T, TO> method
Pushes a named route and removes the current top route.
Implementation
Future<T?> pushReplacementNamed<T, TO>(
String routeName, {
Object? arguments,
TO? result,
}) {
final settings = RouteSettings(name: routeName, arguments: arguments);
final route = _createRoute(settings);
if (route == null) {
throw StateError(
'Navigator.pushReplacementNamed called with a route name that could '
'not be resolved: "$routeName".',
);
}
return pushReplacement<T, TO>(route as Route<T>, result: result);
}