of static method

DrawerThemeData of(
  1. BuildContext context

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

If there is no enclosing DrawerTheme widget, then ThemeData.drawerTheme is used.

Typical usage is as follows:

DrawerThemeData theme = DrawerTheme.of(context);


static DrawerThemeData of(BuildContext context) {
  final DrawerTheme? drawerTheme = context.dependOnInheritedWidgetOfExactType<DrawerTheme>();
  return drawerTheme?.data ?? Theme.of(context).drawerTheme;