pushReplacement<T extends Object?, TO extends Object?> method
Replace the current page
of the navigator by pushing the given page
and then
disposing the previous route once the new route has finished animating in.
transitionDuration
will be Duration.zero when transition
is equals to Transition.none
backGestureEnabled
ignored when transition
is Transition.material or Transition.cupertino
Implementation
Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
Widget page, {
Object? arguments,
bool maintainState = true,
bool fullscreenDialog = false,
Transition? transition,
Duration transitionDuration = const Duration(milliseconds: 300),
bool backGestureEnabled = false,
TO? result,
}) {
return _navigator.pushReplacement<T, TO>(
getRoute(
page,
arguments: arguments,
maintainState: maintainState,
fullscreenDialog: fullscreenDialog,
transition: transition,
transitionDuration: transitionDuration,
backGestureEnabled: backGestureEnabled,
),
result: result,
);
}