IntervalSlider.adaptive constructor

const IntervalSlider.adaptive({
  1. Key? key,
  2. required double value,
  3. required ValueChanged<double>? onChanged,
  4. ValueChanged<double>? onChangeStart,
  5. ValueChanged<double>? onChangeEnd,
  6. double min = 0.0,
  7. double max = 1.0,
  8. List<double> intervalPoints = const [],
  9. int? divisions,
  10. String? label,
  11. MouseCursor? mouseCursor,
  12. Color? activeColor,
  13. Color? inactiveColor,
  14. SemanticFormatterCallback? semanticFormatterCallback,
  15. FocusNode? focusNode,
  16. bool autofocus = false,
})

Creates an adaptive IntervalSlider based on the target platform, following Material design's Cross-platform guidelines.

Creates a CupertinoSlider if the target platform is iOS, creates a Material Design slider otherwise.

If a CupertinoSlider is created, the following parameters are ignored: label, inactiveColor, semanticFormatterCallback.

The target platform is based on the current Theme: ThemeData.platform.

实际上,没有实现ios,只实现了 material 版本

Implementation

const IntervalSlider.adaptive({
  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.mouseCursor,
  this.activeColor,
  this.inactiveColor,
  this.semanticFormatterCallback,
  this.focusNode,
  this.autofocus = false,
})  : _sliderType = _SliderType.adaptive,
      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);