SliderThemeData class

Holds the color, shape, and typography values for a material design slider theme.

Use this class to configure a SliderTheme widget, or to set the ThemeData.sliderTheme for a Theme widget.

To obtain the current ambient slider theme, use SliderTheme.of.

The parts of a slider are:

  • The "thumb", which is a shape that slides horizontally when the user drags it.
  • The "rail", which is the line that the slider thumb slides along.
  • The "value indicator", which is a shape that pops up when the user is dragging the thumb to indicate the value being selected.
  • The "active" side of the slider is the side between the thumb and the minimum value.
  • The "inactive" side of the slider is the side between the thumb and the maximum value.
  • The Slider is disabled when it is not accepting user input. See Slider for details on when this happens.

The thumb and the value indicator may have their shapes and behavior customized by creating your own SliderComponentShape that does what you want. See RoundSliderThumbShape and PaddleSliderValueIndicatorShape for examples.

See also:

Inheritance

Constructors

SliderThemeData({@required Color activeRailColor, @required Color inactiveRailColor, @required Color disabledActiveRailColor, @required Color disabledInactiveRailColor, @required Color activeTickMarkColor, @required Color inactiveTickMarkColor, @required Color disabledActiveTickMarkColor, @required Color disabledInactiveTickMarkColor, @required Color thumbColor, @required Color disabledThumbColor, @required Color overlayColor, @required Color valueIndicatorColor, @required SliderComponentShape thumbShape, @required SliderComponentShape valueIndicatorShape, @required ShowValueIndicator showValueIndicator, @required TextStyle valueIndicatorTextStyle })
Create a SliderThemeData given a set of exact values. All the values must be specified. [...]
const
SliderThemeData.fromPrimaryColors({@required Color primaryColor, @required Color primaryColorDark, @required Color primaryColorLight, @required TextStyle valueIndicatorTextStyle })
Generates a SliderThemeData from three main colors. [...]
factory

Properties

activeRailColor Color
The color of the Slider rail between the Slider.min position and the current thumb position.
final
activeTickMarkColor Color
The color of the rail's tick marks that are drawn between the Slider.min position and the current thumb position.
final
disabledActiveRailColor Color
The color of the Slider rail between the Slider.min position and the current thumb position when the Slider is disabled.
final
disabledActiveTickMarkColor Color
The color of the rail's tick marks that are drawn between the Slider.min position and the current thumb position when the Slider is disabled.
final
disabledInactiveRailColor Color
The color of the Slider rail between the current thumb position and the Slider.max position when the Slider is disabled.
final
disabledInactiveTickMarkColor Color
The color of the rail's tick marks that are drawn between the current thumb position and the Slider.max position when the Slider is disabled.
final
disabledThumbColor Color
The color given to the thumbShape to draw itself with when the Slider is disabled.
final
hashCode int
The hash code for this object. [...]
read-only
inactiveRailColor Color
The color of the Slider rail between the current thumb position and the Slider.max position.
final
inactiveTickMarkColor Color
The color of the rail's tick marks that are drawn between the current thumb position and the Slider.max position.
final
overlayColor Color
The color of the overlay drawn around the slider thumb when it is pressed. [...]
final
showValueIndicator ShowValueIndicator
Whether the value indicator should be shown for different types of sliders. [...]
final
thumbColor Color
The color given to the thumbShape to draw itself with.
final
thumbShape SliderComponentShape
The shape and behavior that will be used to draw the Slider's thumb. [...]
final
valueIndicatorColor Color
The color given to the valueIndicatorShape to draw itself with.
final
valueIndicatorShape SliderComponentShape
The shape and behavior that will be used to draw the Slider's value indicator. [...]
final
valueIndicatorTextStyle TextStyle
The text style for the text on the value indicator. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

copyWith({Color activeRailColor, Color inactiveRailColor, Color disabledActiveRailColor, Color disabledInactiveRailColor, Color activeTickMarkColor, Color inactiveTickMarkColor, Color disabledActiveTickMarkColor, Color disabledInactiveTickMarkColor, Color thumbColor, Color disabledThumbColor, Color overlayColor, Color valueIndicatorColor, SliderComponentShape thumbShape, SliderComponentShape valueIndicatorShape, ShowValueIndicator showValueIndicator, TextStyle valueIndicatorTextStyle }) SliderThemeData
Creates a copy of this object but with the given fields replaced with the new values.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toDiagnosticsNode({String name, DiagnosticsTreeStyle style }) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by toStringDeep. [...]
inherited
toString({DiagnosticLevel minLevel: DiagnosticLevel.debug }) String
Returns a string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]

Static Methods

lerp(SliderThemeData a, SliderThemeData b, double t) SliderThemeData
Linearly interpolate between two slider themes. [...]