of static method

  1. @Deprecated("'PushButton' no longer uses singular colors and therefore cannot " "be themed using a 'PushButtonTheme'.")
PushButtonThemeData of(
  1. BuildContext context
)

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

If there is no enclosing PushButtonTheme widget, then MacosThemeData.pushButtonTheme is used.

Typical usage is as follows:

PushButtonTheme theme = PushButtonTheme.of(context);

Implementation

@Deprecated(
    "'PushButton' no longer uses singular colors and therefore cannot "
    "be themed using a 'PushButtonTheme'.")
static PushButtonThemeData of(BuildContext context) {
  final PushButtonTheme? buttonTheme =
      context.dependOnInheritedWidgetOfExactType<PushButtonTheme>();
  return buttonTheme?.data ?? MacosTheme.of(context).pushButtonTheme;
}