The color from the closest instance of this class that encloses the given context.
Typical usage is as follows:
ButtonTheme theme = ButtonTheme.of(context);
Source
static ButtonTheme of(BuildContext context) {
ButtonTheme result = context.inheritFromWidgetOfExactType(ButtonTheme);
return result ?? const ButtonTheme();
}