replace<T extends Object?, TO extends Object?> method
Replace the current route with the new route
.
The state
is passed as the route arguments.
result
is used to resolve the Future of the current route.
Implementation
Future<T?> replace<T extends Object?, TO extends Object?>(
String route, {
Object? state,
TO? result,
}) {
return _navigatorKey.currentState!.pushReplacementNamed<T?, TO?>(
route,
arguments: state,
result: result,
);
}