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,
) =>
Navigator.of(this).pushReplacement<T, TO>(
MaterialPageRoute<T>(builder: (BuildContext _) => route),
);