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

Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
  1. Widget page, {
  2. String? navigator,
  3. RouteType? routeType,
  4. RouteSettings? settings,
  5. bool? maintainState,
  6. bool? fullscreenDialog,
  7. bool? allowSnapshotting,
  8. TO? result,
})

Replace the current page with a new anonymous page route

Implementation

static Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
  Widget page, {
  String? navigator,
  RouteType? routeType,
  RouteSettings? settings,
  bool? maintainState,
  bool? fullscreenDialog,
  bool? allowSnapshotting,
  TO? result,
}) =>
    _getContext(navigator).pushReplacement<T, TO>(
      page,
      routeType: routeType,
      settings: settings,
      maintainState: maintainState,
      fullscreenDialog: fullscreenDialog,
      allowSnapshotting: allowSnapshotting,
      result: result,
    );