replace method

Future<void> replace(
  1. String path, {
  2. Map<String, String>? params,
})

Replace current route.

Implementation

Future<void> replace(String path, {Map<String, String>? params}) async {
  final matchedRoute = _matchRoute(path);
  if (matchedRoute == null) return;

  _currentPath = path;
  _currentParams = params ?? _extractParams(path, matchedRoute.path);
  notifyListeners();
}