toNamedAndOffUntil<T> method

  1. @override
Future<T?> toNamedAndOffUntil<T>(
  1. String page,
  2. bool predicate(
    1. GetPage
    ), [
  3. Object? data
])
override

Implementation

@override
Future<T?> toNamedAndOffUntil<T>(
  String page,
  bool Function(GetPage) predicate, [
  Object? data,
]) async {
  final arguments = _buildPageSettings(page, data);

  final route = _getRouteDecoder<T>(arguments);

  if (route == null) return null;

  while (_activePages.isNotEmpty && !predicate(_activePages.last.route!)) {
    _popWithResult();
  }

  return _push<T>(route);
}