of static method
Read the current PodContainer for a BuildContext.
Implementation
static PodContainer of(
BuildContext context, {
bool listen = true,
}) {
UncontrolledPodScope? scope;
scope = listen
? context //
.dependOnInheritedWidgetOfExactType<UncontrolledPodScope>()
: (context
.getElementForInheritedWidgetOfExactType<UncontrolledPodScope>()
?.widget as UncontrolledPodScope?);
if (scope == null) {
throw StateError('No PodScope found');
}
return scope.container;
}