of static method

IconButtonThemeData of(
  1. BuildContext context
)

Retrieves the IconButtonThemeData from the closest ancestor IconButtonTheme.

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;
}