of static method

Returns the nearest enclosing scope.

Throws:

StateError when no CellRouterScope encloses context.

Implementation

static CellRouterScope of(BuildContext context) {
  final scope = maybeOf(context);
  if (scope == null) {
    throw StateError(
      'CellRouterScope.of: no CellRouterScope above this widget. '
      'Wrap the app in a CellRouterScope before using useCellRouter.',
    );
  }
  return scope;
}