of static method
- BuildContext context
Retrieves the ToggleButtonsThemeData from the closest ancestor ToggleButtonsTheme.
If there is no enclosing ToggleButtonsTheme widget, then ThemeData.toggleButtonsTheme is used.
Typical usage is as follows:
ToggleButtonsThemeData theme = ToggleButtonsTheme.of(context);
Implementation
static ToggleButtonsThemeData of(BuildContext context) {
final ToggleButtonsTheme? toggleButtonsTheme = context
.dependOnInheritedWidgetOfExactType<ToggleButtonsTheme>();
return toggleButtonsTheme?.data ?? Theme.of(context).toggleButtonsTheme;
}