pushNamedAndRemoveUntil<T extends Object> method

Future<T?> pushNamedAndRemoveUntil<T extends Object>(
  1. String routeName, {
  2. Object? args,
  3. bool predicate(
    1. Route
    )?,
})

Push the route with the given name onto the navigator, and then remove all the previous routes until the predicate returns true.

Implementation

Future<T?> pushNamedAndRemoveUntil<T extends Object>(
  String routeName, {
  Object? args,
  bool Function(Route<dynamic>)? predicate,
}) async {
  return navigationKey.currentState?.pushNamedAndRemoveUntil<T>(
    routeName,
    predicate ?? (_) => false,
    arguments: args,
  );
}