useQuery function
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;
}