Slider.adaptive constructor Null safety

const Slider.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. int? divisions,
  9. String? label,
  10. MouseCursor? mouseCursor,
  11. Color? activeColor,
  12. Color? inactiveColor,
  13. Color? thumbColor,
  14. SemanticFormatterCallback? semanticFormatterCallback,
  15. FocusNode? focusNode,
  16. bool autofocus = false}
)

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

Creates a CupertinoSlider if the target platform is iOS or macOS, 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.

Implementation

const Slider.adaptive({
  Key? key,
  required this.value,
  required this.onChanged,
  this.onChangeStart,
  this.onChangeEnd,
  this.min = 0.0,
  this.max = 1.0,
  this.divisions,
  this.label,
  this.mouseCursor,
  this.activeColor,
  this.inactiveColor,
  this.thumbColor,
  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);