MiuixSliderPreference constructor

const MiuixSliderPreference({
  1. Key? key,
  2. required double value,
  3. required ValueChanged<double> onValueChange,
  4. String? title,
  5. MiuixBasicComponentColors? titleColor,
  6. String? summary,
  7. MiuixBasicComponentColors? summaryColor,
  8. Widget? startAction,
  9. String? valueText,
  10. List<Widget>? endActions,
  11. Widget? bottomAction,
  12. VoidCallback? onClick,
  13. bool holdDownState = false,
  14. bool enabled = true,
  15. double min = 0.0,
  16. double max = 1.0,
  17. int steps = 0,
  18. VoidCallback? onValueChangeFinished,
  19. bool reverseDirection = false,
  20. double sliderHeight = MiuixSliderDefaults.minHeight,
  21. MiuixSliderColors? sliderColors,
  22. MiuixSliderHapticEffect hapticEffect = MiuixSliderDefaults.defaultHapticEffect,
  23. bool showKeyPoints = false,
  24. List<double>? keyPoints,
  25. double magnetThreshold = 0.02,
  26. EdgeInsetsGeometry insideMargin = MiuixBasicComponentDefaults.insideMargin,
})

Implementation

const MiuixSliderPreference({
  super.key,
  required this.value,
  required this.onValueChange,
  this.title,
  this.titleColor,
  this.summary,
  this.summaryColor,
  this.startAction,
  this.valueText,
  this.endActions,
  this.bottomAction,
  this.onClick,
  this.holdDownState = false,
  this.enabled = true,
  this.min = 0.0,
  this.max = 1.0,
  this.steps = 0,
  this.onValueChangeFinished,
  this.reverseDirection = false,
  this.sliderHeight = MiuixSliderDefaults.minHeight,
  this.sliderColors,
  this.hapticEffect = MiuixSliderDefaults.defaultHapticEffect,
  this.showKeyPoints = false,
  this.keyPoints,
  this.magnetThreshold = 0.02,
  this.insideMargin = MiuixBasicComponentDefaults.insideMargin,
})  : assert(steps >= 0, 'steps should be >= 0'),
      assert(min < max, 'min should be less than max');