popUntilNav method

void popUntilNav(
  1. UntilFn test, {
  2. bool routeTest(
    1. Route route
    )?,
})

Implementation

void popUntilNav(UntilFn test, {bool Function(Route route)? routeTest}) {
  final nav = navigatorKey.currentState;
  if (nav == null) return;
  nav.popUntil((route) {
    if (route.settings case RouteQueueEntryPage page) {
      return test(page.entry);
    }
    return routeTest?.call(route) ?? false;
  });
}