of static method

RouteScopeProvider of(
  1. BuildContext context
)

Looks up the nearest RouteScopeProvider from context.

Implementation

static RouteScopeProvider of(BuildContext context) {
  final scope = context
      .dependOnInheritedComponentOfExactType<RouteScopeProvider>();
  if (scope != null) return scope;

  throw StateError('Unrouter route scope is unavailable in this context.');
}