of static method
- BuildContext context
Returns the closest instance of this class's data value that encloses the given context. If there is no ancestor, it returns ThemeData.menuTheme.
Typical usage is as follows:
MenuThemeData theme = MenuTheme.of(context);
Implementation
static MenuThemeData of(BuildContext context) {
final MenuTheme? menuTheme = context.dependOnInheritedWidgetOfExactType<MenuTheme>();
return menuTheme?.data ?? Theme.of(context).menuTheme;
}