go method

void go(
  1. String route, {
  2. Object? extra,
  3. String path = "",
  4. Map<String, dynamic> queryParams = const <String, dynamic>{},
})

Implementation

void go(
  String route, {
  Object? extra,
  String path = "",
  Map<String, dynamic> queryParams = const <String, dynamic>{},
}) {
  if (path.isNotEmpty || queryParams.isNotEmpty) {
    if (kIsWeb) {
      context.goNamed(
        route,
        extra: extra,
        pathParameters: {"name": path},
        queryParameters: queryParams,
      );
    } else {
      context.pushNamed(
        route,
        extra: extra,
        pathParameters: {"name": path},
        queryParameters: queryParams,
      );
    }
  } else {
    if (kIsWeb) {
      context.go(route, extra: extra);
    } else {
      context.push(route, extra: extra);
    }
  }
}