pushReplacement<T, R> method

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

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