DHSlider constructor

DHSlider({
  1. Key? key,
  2. SliderTrackShape? trackShape,
  3. Image? trackImage,
  4. double? trackHeight,
  5. Color? activeTrackColor,
  6. Color? inactiveTrackColor,
  7. Color? disabledActiveTrackColor,
  8. Color? disabledInactiveTrackColor,
  9. Color? thumbColor,
  10. Color? disabledThumbColor,
  11. double enabledThumbRadius = 12.0,
  12. double? disabledThumbRadius,
  13. Image? thumbImage,
  14. SliderComponentShape? thumbShape,
  15. SliderComponentShape? indicatorShape,
  16. Indicator? indicator,
  17. IndicatorStyle? indicatorStyle,
  18. BorderSide? thumbBorderSide,
  19. required double value,
  20. bool disabled = false,
  21. double min = 0.0,
  22. double max = 1.0,
  23. int? divisions,
  24. String? label,
  25. FocusNode? focusNode,
  26. bool autoFocus = false,
  27. ShowValueIndicator? showValueIndicator,
  28. TextStyle? indicatorTextStyle,
  29. ValueChanged<double>? onChangeStart,
  30. ValueChanged<double>? onChangeEnd,
  31. ValueChanged<double>? onChanged,
  32. double? width,
  33. double? height,
  34. Color? backgroundColor,
  35. EdgeInsetsGeometry? padding,
  36. EdgeInsetsGeometry? margin,
})

Implementation

DHSlider({
  Key? key,
  SliderTrackShape? trackShape,
  ui.Image? trackImage,
  this.trackHeight,
  this.activeTrackColor,
  this.inactiveTrackColor,
  this.disabledActiveTrackColor,
  this.disabledInactiveTrackColor,
  this.thumbColor,
  this.disabledThumbColor,
  double enabledThumbRadius = 12.0,
  double? disabledThumbRadius,
  ui.Image? thumbImage,
  SliderComponentShape? thumbShape,
  SliderComponentShape? indicatorShape,
  Indicator? indicator,
  IndicatorStyle? indicatorStyle,
  BorderSide? thumbBorderSide,
  required this.value,
  this.disabled = false,
  this.min = 0.0,
  this.max = 1.0,
  this.divisions,
  this.label,
  this.focusNode,
  this.autoFocus = false,
  this.showValueIndicator,
  this.indicatorTextStyle,
  this.onChangeStart,
  this.onChangeEnd,
  this.onChanged,
  this.width,
  this.height,
  this.backgroundColor,
  this.padding,
  this.margin,
})  : assert(value != null),
      assert(min != null),
      assert(max != null),
      assert(min <= max),
      assert(value >= min && value <= max),
      assert(divisions == null || divisions > 0),
      assert(disabled != null),
      this.trackShape = trackShape ?? DHSliderTrackShape(image: trackImage),
      this.thumbShape = thumbShape ??
          DHThumbShape(
            enabledThumbRadius: enabledThumbRadius,
            disabledThumbRadius: disabledThumbRadius,
            borderSide: thumbBorderSide ?? BorderSide.none,
            image: thumbImage,
          ),
      this.indicatorShape = indicatorShape ??
          (indicator != null
              ? DHIndicatorShape(indicator, indicatorStyle)
              : null),
      super(key: key);