DHSlider constructor
DHSlider({
- Key? key,
- SliderTrackShape? trackShape,
- Image? trackImage,
- double? trackHeight,
- Color? activeTrackColor,
- Color? inactiveTrackColor,
- Color? disabledActiveTrackColor,
- Color? disabledInactiveTrackColor,
- Color? thumbColor,
- Color? disabledThumbColor,
- double enabledThumbRadius = 12.0,
- double? disabledThumbRadius,
- Image? thumbImage,
- SliderComponentShape? thumbShape,
- SliderComponentShape? indicatorShape,
- Indicator? indicator,
- IndicatorStyle? indicatorStyle,
- BorderSide? thumbBorderSide,
- required double value,
- bool disabled = false,
- double min = 0.0,
- double max = 1.0,
- int? divisions,
- String? label,
- FocusNode? focusNode,
- bool autoFocus = false,
- ShowValueIndicator? showValueIndicator,
- TextStyle? indicatorTextStyle,
- ValueChanged<
double> ? onChangeStart, - ValueChanged<
double> ? onChangeEnd, - ValueChanged<
double> ? onChanged, - double? width,
- double? height,
- Color? backgroundColor,
- EdgeInsetsGeometry? padding,
- 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);