MacosSlider constructor

const MacosSlider({
  1. Key? key,
  2. required double value,
  3. required ValueChanged<double> onChanged,
  4. bool discrete = false,
  5. int splits = 15,
  6. double min = 0.0,
  7. double max = 1.0,
  8. Color color = CupertinoColors.systemBlue,
  9. Color backgroundColor = MacosColors.sliderBackgroundColor,
  10. Color tickBackgroundColor = MacosColors.tickBackgroundColor,
  11. Color thumbColor = MacosColors.sliderThumbColor,
  12. 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);