toReplacement<T extends Object?, TO extends Object?> method
Find the page with given routeName and remove the current route and replace it with the new one.
It is similar to _navigate.toReplacementNamed
method.
Implementation
Future<T?> toReplacement<T extends Object?, TO extends Object?>(
String routeName, {
TO? result,
Object? arguments,
Map<String, String>? queryParams,
bool fullscreenDialog = false,
bool maintainState = true,
Widget Function(
BuildContext context,
Animation<double> animation,
Animation<double> secondAnimation,
Widget child,
)? transitionsBuilder,
}) {
return _navigationBuilder.toReplacement<T, TO>(
routeName,
result: result,
arguments: arguments,
queryParams: queryParams,
fullscreenDialog: fullscreenDialog,
maintainState: maintainState,
transitionsBuilder: transitionsBuilder,
);
}