maybeElementOf static method
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;
}