CustomRangeSlider constructor
const
CustomRangeSlider({
- Key? key,
- double initLeftValue = 0,
- double initRightValue = 1,
- 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()?,
Implementation
const CustomRangeSlider({
super.key,
this.initLeftValue = 0,
this.initRightValue = 1,
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(initLeftValue <= initRightValue,
'The initial value on the left of the range track is not greater than the initial value on the right.'),
assert(minValue <= maxValue,
'The minimum value of the range track is not greater than the maximum value.'),
assert(minValue <= initLeftValue && initLeftValue <= maxValue,
'The left initial value of the range track should be no less than the track min and no more than the track max.'),
assert(minValue <= initRightValue && initRightValue <= maxValue,
'The right initial value of the range track should be no less than the track min and no more than the track max.');