maybeOf static method

DrivenSpinnerThemeData? maybeOf(
  1. BuildContext context
)

The data from the closest instance of this class that encloses the given context.

Typical usage is as follows:

DrivenSpinnerThemeData theme = DrivenSpinnerTheme.of(context);

Implementation

static DrivenSpinnerThemeData? maybeOf(BuildContext context) {
  final parentTheme =
      context.dependOnInheritedWidgetOfExactType<DrivenSpinnerTheme>();
  if (parentTheme != null) return parentTheme.data;

  final globalTheme = Theme.of(context).extension<DrivenSpinnerThemeData>();
  return globalTheme;
}