maybeOf<S extends Spec<S> > static method
Gets the closest Style from the widget tree, or null if not found.
Implementation
static Style<S>? maybeOf<S extends Spec<S>>(BuildContext context) {
final provider = context.getInheritedWidgetOfExactType<StyleProvider<S>>();
return provider?.style;
}