offUntil<T> method
Implementation
@override
Future<T?> offUntil<T>(
Widget Function() page,
bool Function(GetPage) predicate, [
Object? arguments,
]) async {
_pendingReplaceReport = true;
while (_activePages.isNotEmpty && !predicate(_activePages.last.route!)) {
_popWithResult();
}
// [to] clears the pending replace report for ordinary pushes; mark this
// push as delegated so the flag set above survives. The guard only needs
// to cover the synchronous prefix of [to], which is where the clear runs.
_delegatedReplaceNavigation = true;
final result = to<T>(page, arguments: arguments);
_delegatedReplaceNavigation = false;
return result;
}