removeWhere method

bool removeWhere(
  1. RouteDataPredicate predicate, {
  2. bool notify = true,
})

Removes any route that satisfied the predicate.

Note: removeRoute does not respect willPopScopes

Implementation

bool removeWhere(RouteDataPredicate predicate, {bool notify = true}) {
  var didRemove = false;
  for (var entry in List<AutoRoutePage>.unmodifiable(_pages)) {
    if (predicate(entry.routeData)) {
      didRemove = true;
      removeRoute(entry.routeData);
    }
  }
  if (notify) {
    notifyAll(forceUrlRebuild: true);
  }
  return didRemove;
}