of static method
Finds the nearest InheritedTheme instance in the component tree.
This scans the component tree upwards from the parent of context
until it finds an instance of InheritedTheme.
Returns null if no InheritedTheme is in the component tree.
Implementation
static InheritedTheme? of(BuildContext context) {
return context.dependOnInheritedComponentOfExactType<InheritedTheme>();
}