SliderValue class
Represents a slider value, supporting both single and range configurations.
A SliderValue can represent either a single point value or a dual-thumb range with start and end values. Use SliderValue.single for single-thumb sliders and SliderValue.ranged for range sliders.
This class provides value interpolation, division rounding, and comparison operations needed for slider animations and discrete value snapping.
Example:
// Single value slider
final single = SliderValue.single(0.5);
print(single.value); // 0.5
// Range slider
final range = SliderValue.ranged(0.2, 0.8);
print(range.start); // 0.2
print(range.end); // 0.8
Constructors
- SliderValue.ranged(double _start, double _end)
-
Creates a range SliderValue with start and end positions.
const
- SliderValue.single(double value)
-
Creates a single-value SliderValue with the specified
value.const
Properties
- end → double
-
The end position of the slider value.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- isRanged → bool
-
Whether this is a range slider value (dual-thumb).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- start → double
-
The start position of the slider value.
no setter
- value → double
-
The value position for single-value sliders.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
roundToDivisions(
int divisions) → SliderValue - Rounds the slider value to discrete divisions.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
lerp(
SliderValue? a, SliderValue? b, double t) → SliderValue? - Linearly interpolates between two SliderValue objects.