of static method

Get the ThemeProviderState from the widget tree

Implementation

static ThemeProviderState of(BuildContext context) {
  final inherited =
      context.dependOnInheritedWidgetOfExactType<_ThemeProviderInherited>();
  assert(inherited != null, 'ThemeProvider not found in widget tree');
  return inherited!.state;
}