of static method

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

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

Typical usage is as follows:

TextButtonTheme theme = TextButtonTheme.of(context);

Implementation

static ContainedButtonThemeData of(BuildContext context) {
  final ContainedButtonTheme? buttonTheme = context.dependOnInheritedWidgetOfExactType<ContainedButtonTheme>();
  return buttonTheme?.data ?? GBTheme.of(context).containedButtonTheme;
}