of method Null safety
- BuildContext context
Retrieves the HeroController from the closest HeroControllerScope ancestor.
Implementation
static HeroController? of(BuildContext context) {
final HeroControllerScope? host = context.dependOnInheritedWidgetOfExactType<HeroControllerScope>();
return host?.controller;
}