replace static method

void replace(
  1. String? route,
  2. String? previousRoute
)

Implementation

static void replace(String? route, String? previousRoute) {
  final mRoute = route.trimmedRoute;
  if (_isIgnorableRoute(mRoute)) return;
  if (!_isSupportedRoute(mRoute)) return;
  if (previousRoute != null) {
    i._routes.remove(previousRoute.trimmedRoute);
  } else {
    i._routes.removeLast();
  }
  i._routes.add(mRoute);
  i.notifyListeners();
}