goHome method

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

Implementation

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