SegmentedControlStyle class
Defines the visual configuration for a SegmentedControl widget.
This class encapsulates all styling properties, allowing for a clean separation between the widget's logic and its appearance. An instance of this class can be passed to the SegmentedControl.style property.
For a convenient way to create a style, use the SegmentedControl.styleFrom static method.
Constructors
- SegmentedControlStyle({BorderRadius? borderRadius, Color? borderColor, double borderWidth = 1.0, Color? backgroundColor, EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 4, vertical: 2), double elevation = 0.0, Color? indicatorColor, EdgeInsets? indicatorMargin, double indicatorElevation = 0.0, TextStyle? unselectedTextStyle, TextStyle? selectedTextStyle})
-
Creates a style object for the SegmentedControl.
const
Properties
- backgroundColor → Color?
-
The background color of the main track.
final
- borderColor → Color?
-
The color of the border around the track.
final
- borderRadius → BorderRadius?
-
The border radius for the outer track and the inner sliding indicator.
final
- borderWidth → double
-
The width of the border around the track.
final
- elevation → double
-
The elevation of the main track, used to cast a shadow.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- indicatorColor → Color?
-
The background color of the sliding indicator.
final
- indicatorElevation → double
-
The elevation of the sliding indicator, used to cast a shadow.
final
- indicatorMargin → EdgeInsets?
-
The margin around the sliding indicator, creating a gap between it and
the track.
final
- padding → EdgeInsets
-
The inner padding of the track, creating space between the border
and the segments area.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedTextStyle → TextStyle?
-
The text style for the currently selected segment.
final
- unselectedTextStyle → TextStyle?
-
The text style for the segments that are not currently selected.
final
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