of static method

Returns reference of the AdaptiveThemeManager which allows access of the state object of AdaptiveTheme in a restrictive way.

Implementation

static AdaptiveThemeManager<ThemeData> of(BuildContext context) {
  context.dependOnInheritedWidgetOfExactType<
      InheritedAdaptiveTheme<ThemeData>>()!;
  return context.findAncestorStateOfType<State<AdaptiveTheme>>()!
      as AdaptiveThemeManager<ThemeData>;
}