of<T extends Object> static method
Obtains the nearest Scope
If not found searches in GlobalScope.read
Throw ScopeNotFoundException if T
not exist.
Implementation
static T of<T extends Object>(
BuildContext context, {
bool listen = false,
}) {
T? value;
value = maybeOf<T>(context, listen: listen);
if (value == null) {
throw ScopeNotFoundException(T);
}
return value;
}