offAllNamed method

  1. @override
Future<T?>? offAllNamed(
  1. String newRouteName, {
  2. Object? arguments,
  3. String? id,
  4. Map<String, String>? parameters,
})
override

Navigates off all named pages and returns a result of type T.

Implementation

@override
Future<T?>? offAllNamed(
  String newRouteName, {
  Object? arguments,
  String? id,
  Map<String, String>? parameters,
}) async {
  final PageSettings args = _buildPageSettings(newRouteName, arguments);
  final RouteDecoder<T>? route = _getRouteDecoder(args);
  if (route == null) {
    return null;
  }

  while (_activePages.length > 1) {
    _activePages.removeLast();
  }

  return _replaceNamed(route);
}