Skip to content

Slider

A customizable slider component for selecting single values or ranges from a continuous scale.

The DragSlider and DragRangeSlider widgets provide horizontal sliders with customizable appearance including track height, thumb radius, colors, and interactive behavior. They wrap Flutter’s built-in Slider components with consistent styling options.

  • Slider Types: Single value, Range selection.
  • Customizable: Supports custom colors, dimensions, divisions, and interaction modes.
  • Responsive: Handles touch, mouse, and keyboard interactions.

A slider for selecting a single value from a range.


A slider for selecting a range of values with two thumbs.


PropertyTypeDescription
valuedoubleThe current value of the slider.
onChangedvoid Function(double)?Callback function when the slider value changes.
onChangeStartvoid Function(double)?Callback function when the user starts changing the slider value.
onChangeEndvoid Function(double)?Callback function when the user finishes changing the slider value.
mindoubleThe minimum value of the slider range.
maxdoubleThe maximum value of the slider range.
thumbRadiusdoubleThe radius of the slider thumb in logical pixels.
trackHeightdoubleThe height of the slider track in logical pixels.
divisionsint?The number of discrete divisions on the slider track.
activeColorColor?The color of the active portion of the slider track.
inactiveColorColor?The color of the inactive portion of the slider track.
secondaryActiveColorColor?The color of the secondary active track (used for additional visual feedback).
thumbColorColor?The color of the slider thumb.
overlayColorWidgetStateProperty<Color?>?The color of the overlay that appears when the slider is pressed.
mouseCursorMouseCursor?The cursor to display when hovering over the slider.
focusNodeFocusNode?The focus node for keyboard navigation.
autofocusboolWhether the slider should automatically gain focus when the widget is built.
allowedInteractionSliderInteraction?The types of interaction allowed for the slider.
paddingEdgeInsetsGeometry?The padding around the slider.
PropertyTypeDescription
valuesRangeValuesThe current values of the range slider (start and end values).
onChangedvoid Function(RangeValues)?Callback function when the slider range values change.
onChangeStartvoid Function(RangeValues)?Callback function when the user starts changing the slider range values.
onChangeEndvoid Function(RangeValues)?Callback function when the user finishes changing the slider range values.
mindoubleThe minimum value of the slider range. Defaults to 0.
maxdoubleThe maximum value of the slider range. Defaults to 100.
thumbRadiusdoubleThe radius of the slider thumbs in logical pixels. Defaults to 8.
trackHeightdoubleThe height of the slider track in logical pixels. Defaults to 4.
divisionsint?The number of discrete divisions on the slider track.
activeColorColor?The color of the active portion of the slider track (between the two thumbs).
inactiveColorColor?The color of the inactive portions of the slider track.
overlayColorWidgetStateProperty<Color?>?The color of the overlay that appears when the slider thumbs are pressed.