maybeOf static method

WxAnchorThemeData? maybeOf(
  1. BuildContext context
)

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

Typical usage is as follows:

WxSheetThemeData theme = WxSheetTheme.of(context);

Implementation

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

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