pushReplacement<T extends Object?, TO extends Object?> method
Replaces the current route.
Example:
context.pushReplacement(MyPage());
Implementation
Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
Widget route,
) {
return Navigator.of(this).pushReplacement<T, TO>(
MaterialPageRoute(builder: (_) => route),
);
}