popUntil method

void popUntil(
  1. bool predicate(
    1. Route
    )
)

Pops routes until predicate returns true for a route.

The route for which predicate returns true is NOT popped.

Implementation

void popUntil(bool Function(Route<dynamic>) predicate) {
  while (_routes.isNotEmpty && !predicate(_routes.last)) {
    pop();
  }
}