pushReplacement<T, R> method
Replace the current screen with a new one.
Implementation
Future<T?> pushReplacement<T, R>(Widget page, {R? result}) {
return Navigator.of(this).pushReplacement(
MaterialPageRoute(builder: (_) => page),
result: result,
);
}