of static method

WidgetContext of(
  1. BuildContext context
)

Implementation

static WidgetContext of(BuildContext context) {
  final scope = context.dependOnInheritedWidgetOfExactType<WidgetContextScope>();
  return scope?.contextValue ??
      (throw FlutterError('No WidgetContextScope found in context'));
}