of static method

IconButtonThemeData of(
  1. BuildContext context
)

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

If there is no enclosing IconButtonTheme widget, then ThemeData.iconButtonTheme is used.

Typical usage is as follows:

IconButtonThemeData theme = IconButtonTheme.of(context);

Implementation

static IconButtonThemeData of(BuildContext context) {
  final IconButtonTheme? buttonTheme = context.dependOnInheritedWidgetOfExactType<IconButtonTheme>();
  return buttonTheme?.data ?? Theme.of(context).iconButtonTheme;
}