StyledSlider constructor
StyledSlider({
- Key? key,
- required double value,
- required ValueChanged<
double> ? onChanged, - required Style trackStyle,
- required Style thumbStyle,
- Style? thumbPressedStyle,
- Style? thumbHoveredStyle,
- Style? thumbDisabledStyle,
- Style? activeTrackStyle,
- Style? toolTipStyle,
- Widget? thumbChild,
- Axis direction = Axis.horizontal,
- Curve curve = Curves.linear,
- Duration duration = const Duration(milliseconds: 100),
- ValueChanged<
double> ? onChangeStart, - ValueChanged<
double> ? onChangeEnd, - double min = 0.0,
- double max = 1.0,
- int? divisions,
- 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");