useQuery function

URLSearchParams useQuery(
  1. BuildContext context
)

Returns query params from the nearest route scope.

Throws a FlutterError when no RouteScopeProvider is found above the current BuildContext.

Implementation

URLSearchParams useQuery(BuildContext context) {
  return RouteScopeProvider.of(context, RouteScope.query).query;
}