of static method

Access the scope from a context subtree. Should be called by descendants of InternalScopeProvider.

It reads the widget, therefore it does not create context dependency.

Implementation

static InternalScope of(BuildContext context) {
  return context.getElementForInheritedWidgetOfExactType<InternalScopeProvider>()!.widget as InternalScopeProvider;
}