of static method

OutletScope of(
  1. BuildContext context
)

Looks up the nearest OutletScope from context.

Implementation

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

  throw StateError('Outlet must be used inside a routed view.');
}