CustomSingleSlider constructor

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