StyledSlider constructor

StyledSlider({
  1. Key? key,
  2. required double value,
  3. required ValueChanged<double>? onChanged,
  4. required Style trackStyle,
  5. required Style thumbStyle,
  6. Style? thumbPressedStyle,
  7. Style? thumbHoveredStyle,
  8. Style? thumbDisabledStyle,
  9. Style? activeTrackStyle,
  10. Style? toolTipStyle,
  11. Widget? thumbChild,
  12. Axis direction = Axis.horizontal,
  13. Curve curve = Curves.linear,
  14. Duration duration = const Duration(milliseconds: 100),
  15. ValueChanged<double>? onChangeStart,
  16. ValueChanged<double>? onChangeEnd,
  17. double min = 0.0,
  18. double max = 1.0,
  19. int? divisions,
  20. String? label,
})

Implementation

StyledSlider({
  Key? key,
  required this.value,
  required this.onChanged,
  required this.trackStyle,
  required this.thumbStyle,
  this.thumbPressedStyle,
  this.thumbHoveredStyle,
  this.thumbDisabledStyle,
  this.activeTrackStyle,
  this.toolTipStyle,
  this.thumbChild,
  this.direction = Axis.horizontal,
  this.curve = Curves.linear,
  this.duration = const Duration(milliseconds: 100),
  this.onChangeStart,
  this.onChangeEnd,
  this.min = 0.0,
  this.max = 1.0,
  this.divisions,
  this.label,
})  : assert(
          (direction == Axis.horizontal && trackStyle.width != null) ||
              (direction == Axis.vertical && trackStyle.height != null),
          "Slider track needs a specific Dimension in the slider direction"),
      assert(
          thumbStyle.width != null &&
              thumbStyle.width!.isAbsolute &&
              thumbStyle.height != null &&
              thumbStyle.height!.isAbsolute,
          "Thumb needs to have a absolute size");