pushAndRemoveUntil<T extends Object?> method

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

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

Implementation

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