of static method
Gets an Injector from a ]BuildContext]
Implementation
static Injector of(BuildContext context) {
final injectorWidget =
context.dependOnInheritedWidgetOfExactType<_InjectorInheritedWidget>();
if (injectorWidget == null) {
throw InjectorWidgetError._internal(
"No `InjectorWidget` was found in the context.");
}
return injectorWidget.injector;
}