pushAndRemoveUntil<T extends Object?> method

Future<T?> pushAndRemoveUntil<T extends Object?>(
  1. Widget child,
  2. RoutePredicate predicate, {
  3. QuickTransition? transitions,
})

A method that pushes a new route to the Navigator with the given child widget and transition type, and removes all the previous routes until the predicate is satisfied.

Defines the available transition options for animations. Only one transition can be selected at a time.

Available transitions:

The default transition is QuickFade.

Implementation

Future<T?> pushAndRemoveUntil<T extends Object?>(
  Widget child,
  RoutePredicate predicate, {
  QuickTransition? transitions,
}) {
  return Navigator.of(this).pushAndRemoveUntil<T>(
      QuickRouter.builder(child, transitions), predicate);
}