MaterialSegmentButtonData<T extends Object> class
final
Material-specific configuration for a segmented button.
Maps to properties of SegmentedButton on Android.
Constructors
-
MaterialSegmentButtonData({Iterable<
T> ? choices, Widget segmentBuilder(T choice)?, T? selectedChoice, ValueChanged<T?> ? onSelectionChanged, Key? widgetKey, bool emptySelectionAllowed = kDefaultEmptySelectionAllowed, EdgeInsets? expandedInsets, ButtonStyle? style, bool showSelectedIcon = kDefaultShowSelectedIcon, Widget? selectedIcon, Axis direction = kDefaultDirection}) -
Creates Material-specific segmented button configuration.
const
Properties
-
choices
→ Iterable<
T> ? -
The choices to display in the segmented button.
finalinherited
- direction → Axis
-
Layout direction of the segments.
final
- emptySelectionAllowed → bool
-
Whether an empty selection is allowed.
final
- expandedInsets → EdgeInsets?
-
Insets applied when the button is expanded.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
onSelectionChanged
→ ValueChanged<
T?> ? -
A callback for when the selected choice changes.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- segmentBuilder → Widget Function(T choice)?
-
A builder for the segments.
finalinherited
- selectedChoice → T?
-
The currently selected choice.
finalinherited
- selectedIcon → Widget?
-
Icon displayed on the selected segment.
final
- showSelectedIcon → bool
-
Whether to show an icon on the selected segment.
final
- style → ButtonStyle?
-
Button style for the segments.
final
- widgetKey → Key?
-
A key to identify the widget.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- kDefaultDirection → const Axis
- Default value for direction.
- kDefaultEmptySelectionAllowed → const bool
- Default value for emptySelectionAllowed.
- kDefaultShowSelectedIcon → const bool
- Default value for showSelectedIcon.