pushReplacementEasy<T, X> method

Future<T?> pushReplacementEasy<T, X>(
  1. Widget page, {
  2. X? result,
})

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);