of static method

TextButtonThemeData of(
  1. BuildContext context
)

Retrieves the TextButtonThemeData from the closest ancestor TextButtonTheme.

If there is no enclosing TextButtonTheme widget, then ThemeData.textButtonTheme is used.

Typical usage is as follows:

TextButtonThemeData theme = TextButtonTheme.of(context);

Implementation

static TextButtonThemeData of(BuildContext context) {
  final TextButtonTheme? buttonTheme = context
      .dependOnInheritedWidgetOfExactType<TextButtonTheme>();
  return buttonTheme?.data ?? Theme.of(context).textButtonTheme;
}