useRouteParams function

RouteParams useRouteParams(
  1. BuildContext context
)

Returns matched route params from the nearest route scope.

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

Implementation

RouteParams useRouteParams(BuildContext context) {
  return RouteScopeProvider.of(context, RouteScope.params).params;
}