Slider class

A horizontal slider for selecting a numeric value within a range.

Displays a track with a movable thumb. Use divisions to snap to discrete steps between min and max. Calls onChanged as the user adjusts.

Inheritance

Constructors

Slider({Key? key, required int value, int min = 0, int max = 100, int? divisions, required ValueChanged<int>? onChanged, Color? activeColor, Color? inactiveColor, Color? thumbColor, String? label, FocusNode? focusNode})
Creates a Slider with the given value and onChanged callback.
const

Properties

activeColor Color?
The color of the active (filled) portion of the track.
final
divisions int?
The number of discrete divisions; null for continuous sliding.
final
focusNode FocusNode?
An optional focus node for keyboard navigation.
final
hashCode int
The hash code for this object.
no setterinherited
inactiveColor Color?
The color of the inactive (unfilled) portion of the track.
final
key Key?
Controls how one widget replaces another in the tree.
finalinherited
label String?
An optional label displayed to the right of the slider.
final
max int
The maximum value the slider can have.
final
min int
The minimum value the slider can have.
final
onChanged ValueChanged<int>?
Called when the user changes the slider value.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
thumbColor Color?
The color of the thumb indicator.
final
value int
The current value of the slider.
final

Methods

createElement() StatefulElement
Creates the Element for this widget.
inherited
createState() State<Slider>
Creates the mutable state for this widget.
override
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