M3ESegmentedButtonTheme class

Theme values for M3ESegmentedButton.

Inheritance
Annotations

Constructors

M3ESegmentedButtonTheme({double height = 40, double targetSize = 48, double iconSize = 18, double segmentHorizontalPadding = 12, double iconLabelGap = 8, double borderWidth = 1, double focusIndicatorWidth = 3, double focusIndicatorGap = 2, double disabledOutlineOpacity = 0.12, double disabledContentOpacity = 0.38, double? maxWidth, Color? outlineColor, Gradient? outlineGradient, Color? dividerColor, Gradient? dividerGradient, Color? selectedBackgroundColor, Gradient? selectedBackgroundGradient, Gradient? unselectedBackgroundGradient, Color? selectedForegroundColor, Color? unselectedForegroundColor, Gradient? selectedForegroundGradient, Gradient? unselectedForegroundGradient, Color? focusIndicatorColor})
Creates segmented button theme tokens.
const

Properties

borderRadius → BorderRadius
The borderRadius at density 0.
no setter
borderWidth → double
Outline and divider stroke width (1dp).
final
disabledContentOpacity → double
Disabled label/icon opacity (0.38) on onSurface.
final
disabledOutlineOpacity → double
Disabled outline opacity (0.12) on onSurface.
final
dividerColor → Color?
Divider color between segments. Defaults to the group outline color.
final
dividerGradient → Gradient?
Optional gradient for the dividers, sampled across the whole group.
final
focusIndicatorColor → Color?
Focus ring color. Defaults to secondary.
final
focusIndicatorGap → double
Gap between segment surface and focus ring (2dp).
final
focusIndicatorWidth → double
Keyboard focus ring thickness (3dp).
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
Base container height at density 0 (40dp).
final
iconLabelGap → double
Gap between icon and label (8dp).
final
iconSize → double
Leading / selected check icon size (18dp).
final
maxWidth → double?
Optional max width for the group; null = unconstrained.
final
outlineColor → Color?
Group outline color. Defaults to the color scheme outline.
final
outlineGradient → Gradient?
Optional gradient for the group outline ring.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
segmentHorizontalPadding → double
Minimum horizontal padding inside each segment (12dp).
final
selectedBackgroundColor → Color?
Solid selected segment fill. Defaults to secondaryContainer.
final
selectedBackgroundGradient → Gradient?
Optional gradient for selected segments.
final
selectedForegroundColor → Color?
Optional solid color for selected labels and icons.
final
selectedForegroundGradient → Gradient?
Optional gradient for selected labels and icons.
final
targetSize → double
Minimum accessible target edge (48dp).
final
unselectedBackgroundGradient → Gradient?
Optional gradient for unselected segments.
final
unselectedForegroundColor → Color?
Optional solid color for unselected labels and icons.
final
unselectedForegroundGradient → Gradient?
Optional gradient for unselected labels and icons.
final

Methods

backgroundColor(M3EColorScheme scheme, {required bool selected}) → Color?
Background fill for a segment; null when unselected (transparent).
borderRadiusFor(M3ESegmentedButtonDensity density) → BorderRadius
Pill radius from the visual container height.
copyWith({double? height, double? targetSize, double? iconSize, double? segmentHorizontalPadding, double? iconLabelGap, double? borderWidth, double? focusIndicatorWidth, double? focusIndicatorGap, double? disabledOutlineOpacity, double? disabledContentOpacity, double? maxWidth, Color? outlineColor, Gradient? outlineGradient, Color? dividerColor, Gradient? dividerGradient, Color? selectedBackgroundColor, Gradient? selectedBackgroundGradient, Gradient? unselectedBackgroundGradient, Color? selectedForegroundColor, Color? unselectedForegroundColor, Gradient? selectedForegroundGradient, Gradient? unselectedForegroundGradient, Color? focusIndicatorColor}) → M3ESegmentedButtonTheme
Returns a copy with non-null fields replaced.
override
divider(M3EColorScheme scheme, {required bool enabled}) → Color
Solid divider color between segments.
focusColor(M3EColorScheme scheme) → Color
Focus ring color.
foregroundColor(M3EColorScheme scheme, {required bool selected, required bool enabled}) → Color
Foreground for labels and icons.
heightFor(M3ESegmentedButtonDensity density) → double
Visual container height for density (−4dp per level from height).
layoutHeightFor(M3ESegmentedButtonDensity density) → double
Layout height: at least targetSize for the touch target.
lerp(M3ESegmentedButtonTheme? other, double t) → M3ESegmentedButtonTheme
Linearly interpolates between this theme and other.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
outline(M3EColorScheme scheme, {required bool enabled}) → Color
Solid outline color for the group ring.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

defaults → const M3ESegmentedButtonTheme
Spec defaults.