toNamedAndRemoveUntil method

  1. @Deprecated("Avoid use this instance, you should use context.navigator.toNamedAndRemoveUntil(...)")
Future<void> toNamedAndRemoveUntil(
  1. String newRouteName,
  2. bool predicate(
    1. Route
    ), {
  3. Object? arguments,
})

Do that:

Navigator.pushNamedAndRemoveUntil(newRouteName, predicate);

Implementation

@Deprecated(
    "Avoid use this instance, you should use context.navigator.toNamedAndRemoveUntil(...)")
Future<void> toNamedAndRemoveUntil(
  String newRouteName,
  bool Function(Route<dynamic>) predicate, {
  Object? arguments,
}) async {
  await Navigator.pushNamedAndRemoveUntil(
    this,
    newRouteName,
    predicate,
    arguments: arguments,
  );
}