of static method

ElevatedButtonThemeData of(
  1. BuildContext context
)

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

If there is no enclosing ElevatedButtonTheme widget, then ThemeData.elevatedButtonTheme is used.

Typical usage is as follows:

ElevatedButtonThemeData theme = ElevatedButtonTheme.of(context);

Implementation

static ElevatedButtonThemeData of(BuildContext context) {
  final ElevatedButtonTheme? buttonTheme = context.dependOnInheritedWidgetOfExactType<ElevatedButtonTheme>();
  return buttonTheme?.data ?? Theme.of(context).elevatedButtonTheme;
}