maybeOf static method

MacosThemeData? maybeOf(
  1. BuildContext context
)

Retrieves the MacosThemeData from the closest ancestor MacosTheme widget, or a default MacosThemeData if no MacosTheme ancestor exists. The result may be null

Resolves all the colors defined in that MacosThemeData against the given BuildContext on a best-effort basis.

Implementation

static MacosThemeData? maybeOf(BuildContext context) {
  final _InheritedMacosTheme? inheritedTheme =
      context.dependOnInheritedWidgetOfExactType<_InheritedMacosTheme>();
  return inheritedTheme?.theme.data;
}