pushAndRemoveUntil<T extends Object?> static method

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

Remove pages until predicate returns true and push a new anonymous page route

Implementation

static Future<T?> pushAndRemoveUntil<T extends Object?>(
  Widget page,
  bool Function(Route<dynamic> route) predicate, {
  String? navigator,
  RouteType? routeType,
  RouteSettings? settings,
  bool? maintainState,
  bool? fullscreenDialog,
  bool? allowSnapshotting,
}) =>
    _getContext(navigator).pushAndRemoveUntil<T>(
      page,
      routeType: routeType,
      settings: settings,
      maintainState: maintainState,
      fullscreenDialog: fullscreenDialog,
      allowSnapshotting: allowSnapshotting,
      predicate,
    );