MultiSlider(- {required List<double> values,
- required ValueChanged<List<double>>? onChanged,
- double max = 1,
- double min = 0,
- ValueChanged<List<double>>? onChangeStart,
- ValueChanged<List<double>>? onChangeEnd,
- Color? color,
- double horizontalPadding = 26.0,
- double height = 45,
- int? divisions,
- ValueRangePainterCallback? valueRangePainterCallback,
- Key? key}
)
Implementation
MultiSlider({
required this.values,
required this.onChanged,
this.max = 1,
this.min = 0,
this.onChangeStart,
this.onChangeEnd,
this.color,
this.horizontalPadding = 26.0,
this.height = 45,
this.divisions,
this.valueRangePainterCallback,
Key? key,
}) : assert(divisions == null || divisions > 0),
assert(max - min >= 0),
range = max - min,
super(key: key) {
final valuesCopy = [...values]..sort();
for (int index = 0; index < valuesCopy.length; index++) {
assert(
valuesCopy[index] == values[index],
'MultiSlider: values must be in ascending order!',
);
}
assert(
values.first >= min && values.last <= max,
'MultiSlider: At least one value is outside of min/max boundaries!',
);
}