popUntil method
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();
}
}