of static method
- BuildContext context
Retrieves the NavigationDrawerThemeData from the closest ancestor NavigationDrawerTheme.
If there is no enclosing NavigationDrawerTheme widget, then ThemeData.navigationDrawerTheme is used.
Typical usage is as follows:
NavigationDrawerThemeData theme = NavigationDrawerTheme.of(context);
Implementation
static NavigationDrawerThemeData of(BuildContext context) {
final NavigationDrawerTheme? navigationDrawerTheme = context
.dependOnInheritedWidgetOfExactType<NavigationDrawerTheme>();
return navigationDrawerTheme?.data ?? Theme.of(context).navigationDrawerTheme;
}