CustomRangeSlider constructor

const CustomRangeSlider({
  1. Key? key,
  2. double initLeftValue = 0,
  3. double initRightValue = 1,
  4. double maxValue = 1,
  5. double minValue = 0,
  6. double thumbSize = 6,
  7. Color thumbColor = Colors.blue,
  8. Duration thumbAnimationDuration = const Duration(milliseconds: 200),
  9. bool isThumbAnimated = true,
  10. double trackIndent = 3,
  11. double trackHeight = 3,
  12. Color trackColor = Colors.grey,
  13. Color trackActiveColor = Colors.blue,
  14. List<Color>? trackActiveGradientColors,
  15. List<double>? trackActiveGradientStops,
  16. AlignmentGeometry trackActiveGradientBegin = Alignment.centerLeft,
  17. AlignmentGeometry trackActiveGradientEnd = Alignment.centerRight,
  18. TileMode trackActiveGradientTileMode = TileMode.clamp,
  19. bool floatingMark = true,
  20. double floatingMarkWidth = 1,
  21. double floatingMarkIndent = 3,
  22. Color floatingMarkColor = Colors.blue,
  23. dynamic sliderValueMethod(
    1. double leftValue,
    2. double rightValue
    )?,
})

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.');