pushReplacement<T extends Object?, TO extends Object?> method

Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
  1. Widget route
)

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