of static method

AppBarThemeData of(
  1. BuildContext context
)

Retrieves the AppBarThemeData from the closest ancestor AppBarTheme.

If there is no enclosing AppBarTheme widget, then ThemeData.appBarTheme is used.

Typical usage is as follows:

AppBarThemeData theme = AppBarTheme.of(context);

Implementation

static AppBarThemeData of(BuildContext context) {
  final AppBarTheme? appBarTheme = context.dependOnInheritedWidgetOfExactType<AppBarTheme>();
  return appBarTheme?.data ?? Theme.of(context).appBarTheme;
}