CustomSingleSlider constructor
const
CustomSingleSlider({
- Key? key,
- double initValue = 0,
- double maxValue = 1,
- double minValue = 0,
- double thumbSize = 6,
- Color thumbColor = Colors.blue,
- Duration thumbAnimationDuration = const Duration(milliseconds: 200),
- bool isThumbAnimated = true,
- double trackIndent = 3,
- double trackHeight = 3,
- Color trackColor = Colors.grey,
- Color trackActiveColor = Colors.blue,
- List<
Color> ? trackActiveGradientColors, - List<
double> ? trackActiveGradientStops, - AlignmentGeometry trackActiveGradientBegin = Alignment.centerLeft,
- AlignmentGeometry trackActiveGradientEnd = Alignment.centerRight,
- TileMode trackActiveGradientTileMode = TileMode.clamp,
- bool floatingMark = true,
- double floatingMarkWidth = 1,
- double floatingMarkIndent = 3,
- Color floatingMarkColor = Colors.blue,
- dynamic sliderValueMethod(
- double value
Implementation
const CustomSingleSlider({
super.key,
this.initValue = 0,
this.maxValue = 1,
this.minValue = 0,
this.thumbSize = 6,
this.thumbColor = Colors.blue,
this.thumbAnimationDuration = const Duration(milliseconds: 200),
this.isThumbAnimated = true,
this.trackIndent = 3,
this.trackHeight = 3,
this.trackColor = Colors.grey,
this.trackActiveColor = Colors.blue,
this.trackActiveGradientColors,
this.trackActiveGradientStops,
this.trackActiveGradientBegin = Alignment.centerLeft,
this.trackActiveGradientEnd = Alignment.centerRight,
this.trackActiveGradientTileMode = TileMode.clamp,
this.floatingMark = true,
this.floatingMarkWidth = 1,
this.floatingMarkIndent = 3,
this.floatingMarkColor = Colors.blue,
this.sliderValueMethod,
}) : assert(maxValue <= 1,
'The maximum value of the sliding track is a floating point number ranging from 0.0 to 1.0.'),
assert(minValue >= 0,
'The minimum value of the sliding track is a floating point number ranging from 0.0 to 1.0.'),
assert(maxValue >= minValue,
'The maximum value of the sliding track cannot be less than the minimum value.'),
assert(initValue >= minValue && initValue <= maxValue,
'The initial value of the sliding track must be between the maximum value and the minimum value.');