MacosSlider constructor
const
MacosSlider({
- Key? key,
- required double value,
- required ValueChanged<
double> onChanged, - bool discrete = false,
- int splits = 15,
- double min = 0.0,
- double max = 1.0,
- Color color = CupertinoColors.systemBlue,
- Color backgroundColor = MacosColors.sliderBackgroundColor,
- Color tickBackgroundColor = MacosColors.tickBackgroundColor,
- Color thumbColor = MacosColors.sliderThumbColor,
- String? semanticLabel,
A slider is a horizontal track with a control, called a thumb, that people can adjust between a minimum and maximum value.
The slider doesn't maintain any state itself, instead the user is expected to update this widget with a new value whenever the slider changes.
{@image }
Implementation
const MacosSlider({
super.key,
required this.value,
required this.onChanged,
this.discrete = false,
this.splits = 15,
this.min = 0.0,
this.max = 1.0,
this.color = CupertinoColors.systemBlue,
this.backgroundColor = MacosColors.sliderBackgroundColor,
this.tickBackgroundColor = MacosColors.tickBackgroundColor,
this.thumbColor = MacosColors.sliderThumbColor,
this.semanticLabel,
}) : assert(value >= min && value <= max),
assert(min < max),
assert(splits >= 2);