toNamed<T> method

Future<T?> toNamed<T>(
  1. String name, {
  2. Map<String, String> pathParams = const <String, String>{},
  3. Map<String, dynamic> queryParams = const <String, dynamic>{},
  4. Map<String, dynamic> params = const <String, dynamic>{},
})

Implementation

Future<T?> toNamed<T>(
  String name, {
  Map<String, String> pathParams = const <String, String>{},
  Map<String, dynamic> queryParams = const <String, dynamic>{},
  Map<String, dynamic> params = const <String, dynamic>{},
}) {
  if (GetPlatform.isWeb) {
    goNamed(
      name,
      pathParams: pathParams,
      queryParams: queryParams,
      params: params,
    );
    return Future<T>.value(null);
  } else {
    return pushNamed<T>(
      name,
      pathParams: pathParams,
      queryParams: queryParams,
      params: params,
    );
  }
}