pushReplacementEasy<T, X> method
Similar to Navigator.of(context).pushReplacement()
Just give it the page
you want to push
Example
context.pushReplacementEasy(CounterPage());
Implementation
Future<T?> pushReplacementEasy<T, X>(
Widget page, {
X? result,
}) async =>
Navigator.of(this).pushReplacement<T, X>(
MaterialPageRoute(builder: (_) => page),
result: result);