offUntil method

  1. @override
Future<T?> offUntil(
  1. Widget page(),
  2. bool predicate(
    1. GetPage
    ), [
  3. Object? arguments
])
override

Navigates off a page until a certain condition is met, returns a result of type T.

Implementation

@override
Future<T?> offUntil(
  Widget Function() page,
  bool Function(GetPage) predicate, [
  Object? arguments,
]) async {
  while (_activePages.isNotEmpty && !predicate(_activePages.last.route!)) {
    _popWithResult();
  }

  return to(page, arguments: arguments);
}