replaceNamed<T> method

Future<T?> replaceNamed<T>(
  1. String name, {
  2. Map<String, String> pathParameters = const <String, String>{},
  3. Map<String, dynamic> queryParameters = const <String, dynamic>{},
  4. Object? extra,
})

Replaces the top-most page with the named route and optional parameters, preserving the page key.

Implementation

Future<T?> replaceNamed<T>(
  String name, {
  Map<String, String> pathParameters = const <String, String>{},
  Map<String, dynamic> queryParameters = const <String, dynamic>{},
  Object? extra,
}) =>
    App.goRouter?.replaceNamed<T>(
      name,
      pathParameters: pathParameters,
      queryParameters: queryParameters,
      extra: extra,
    ) ??
    Future.value();