of static method

_ThemedState of(
  1. BuildContext context
)

Getter: print(Themed.of(context).theme);

Setter: Themed.of(context).theme = Locale("en", "US");

Implementation

static _ThemedState of(BuildContext context) {
  _InheritedConstTheme? inherited =
      context.dependOnInheritedWidgetOfExactType<_InheritedConstTheme>();

  if (inherited == null)
    throw ConstThemeException("Can't find the `Themed` widget up in the tree. "
        "Please make sure to wrap some ancestor widget with `Themed`.");

  return inherited.data;
}