IntervalSlider constructor
const
IntervalSlider({
- Key? key,
- required double value,
- required ValueChanged<
double> ? onChanged, - ValueChanged<
double> ? onChangeStart, - ValueChanged<
double> ? onChangeEnd, - double min = 0.0,
- double max = 1.0,
- List<
double> intervalPoints = const [], - int? divisions,
- String? label,
- Color? activeColor,
- Color? inactiveColor,
- MouseCursor? mouseCursor,
- SemanticFormatterCallback? semanticFormatterCallback,
- FocusNode? focusNode,
- bool autofocus = false,
Creates a Material Design slider.
The slider itself does not maintain any state. Instead, when the state of the slider changes, the widget calls the onChanged callback. Most widgets that use a slider will listen for the onChanged callback and rebuild the slider with a new value to update the visual appearance of the slider.
- value determines currently selected value for this slider.
- onChanged is called while the user is selecting a new value for the slider.
- onChangeStart is called when the user starts to select a new value for the slider.
- onChangeEnd is called when the user is done selecting a new value for the slider.
You can override some of the colors with the activeColor and inactiveColor properties, although more fine-grained control of the appearance is achieved using a SliderThemeData.
Implementation
const IntervalSlider({
Key? key,
required this.value,
required this.onChanged,
this.onChangeStart,
this.onChangeEnd,
this.min = 0.0,
this.max = 1.0,
this.intervalPoints = const [],
this.divisions,
this.label,
this.activeColor,
this.inactiveColor,
this.mouseCursor,
this.semanticFormatterCallback,
this.focusNode,
this.autofocus = false,
}) : _sliderType = _SliderType.material,
assert(value != null),
assert(min != null),
assert(max != null),
assert(min <= max),
assert(value >= min && value <= max),
assert(divisions == null || divisions > 0),
super(key: key);