IntervalSlider.adaptive constructor
const
IntervalSlider.adaptive({
- Key? key,
- required double value,
- required ValueChanged<
double> ? onChanged, - ValueChanged<
double> ? onChangeStart, - ValueChanged<
double> ? onChangeEnd, - double min = 0.0,
- double max = 1.0,
- List<
double> intervalPoints = const [], - int? divisions,
- String? label,
- MouseCursor? mouseCursor,
- Color? activeColor,
- Color? inactiveColor,
- SemanticFormatterCallback? semanticFormatterCallback,
- FocusNode? focusNode,
- 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);