to<T> method

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

Implementation

Future<T?> to<T>(
  String location, {
  Map<String, dynamic> pathParams = const <String, dynamic>{},
  Map<String, dynamic> queryParams = const <String, dynamic>{},
  Map<String, dynamic> params = const <String, dynamic>{},
}) {
  if (GetPlatform.isWeb) {
    go(
      location,
      pathParams: pathParams,
      queryParams: queryParams,
      params: params,
    );
    return Future<T>.value(null);
  } else {
    return push<T>(
      location,
      pathParams: pathParams,
      queryParams: queryParams,
      params: params,
    );
  }
}