of static method
- BuildContext context
The data from the closest instance of this class that encloses the given context.
If there is no SegmentedButtonTheme in scope, this will return ThemeData.segmentedButtonTheme from the ambient Theme.
Typical usage is as follows:
SegmentedButtonThemeData theme = SegmentedButtonTheme.of(context);
See also:
- maybeOf, which returns null if it doesn't find a SegmentedButtonTheme ancestor.
Implementation
static SegmentedButtonThemeData of(BuildContext context) {
return maybeOf(context) ?? Theme.of(context).segmentedButtonTheme;
}