maybeOf static method

CheckmarkThemeData? maybeOf(
  1. BuildContext context
)

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

Typical usage is as follows:

CheckmarkThemeData theme = CheckmarkTheme.of(context);

Implementation

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

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