maybeElementOf static method

ServiceScopeElement? maybeElementOf(
  1. BuildContext context
)

Looks up the widget tree to find the active ServiceScopeElement.

Implementation

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