of static method

NavigationDrawerThemeData of(
  1. BuildContext context
)

The closest instance of this class that encloses the given context.

If there is no enclosing NavigationDrawerTheme widget, then ThemeData.navigationDrawerTheme is used.

Implementation

static NavigationDrawerThemeData of(BuildContext context) {
  final NavigationDrawerTheme? navigationDrawerTheme =
      context.dependOnInheritedWidgetOfExactType<NavigationDrawerTheme>();
  return navigationDrawerTheme?.data ??
      Theme.of(context).navigationDrawerTheme;
}