offNamedUntil<T> method

  1. @override
Future<T?>? offNamedUntil<T>(
  1. String page, {
  2. bool predicate(
    1. GetPage route
    )?,
  3. dynamic arguments,
  4. String? id,
  5. Map<String, String>? parameters,
})
override

Implementation

@override
Future<T?>? offNamedUntil<T>(
  String page, {
  bool Function(GetPage route)? predicate,
  dynamic arguments,
  String? id,
  Map<String, String>? parameters,
}) async {
  final args = _buildPageSettings(page, arguments);
  final route = _getRouteDecoder<T>(args);
  if (route == null) return null;

  final newPredicate = predicate ?? (route) => false;

  while (_activePages.length > 1 && !newPredicate(_activePages.last.route!)) {
    _activePages.removeLast();
  }

  return _push(route);
}