maybeElementOf static method

StateScopeElement? maybeElementOf(
  1. BuildContext context
)

Looks up the widget tree to find the active StateScopeElement.

Implementation

static StateScopeElement? maybeElementOf(BuildContext context) {
  final element = context.getElementForInheritedWidgetOfExactType<StateScope>();
  return element is StateScopeElement ? element : null;
}