useRouteMeta function

Map<String, Object?> useRouteMeta(
  1. BuildContext context
)

Returns merged route metadata from the nearest route scope.

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

Implementation

Map<String, Object?> useRouteMeta(BuildContext context) {
  final route = RouteScopeProvider.of(context, RouteScope.meta).route;
  return route.meta;
}