of static method

Retrieves the MacosThemeData from the closest ancestor MacosTheme widget, or a default MacosThemeData if no MacosTheme ancestor exists.

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

Implementation

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