toNamedAndOffUntil method
Navigates to a named page and pops pages until a certain condition is met, returns a result of type T
.
Implementation
@override
Future<T?> toNamedAndOffUntil(
String page,
bool Function(GetPage) predicate, [
Object? data,
]) async {
final PageSettings arguments = _buildPageSettings(page, data);
final RouteDecoder<T>? route = _getRouteDecoder(arguments);
if (route == null) {
return null;
}
while (_activePages.isNotEmpty && !predicate(_activePages.last.route!)) {
_popWithResult();
}
return _push(route);
}