CustomBilateralSilder constructor

const CustomBilateralSilder({
  1. Key? key,
  2. double initValue = 0,
  3. double maxValue = 1,
  4. double minValue = -1,
  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 CustomBilateralSilder({
  super.key,
  this.initValue = 0,
  this.maxValue = 1,
  this.minValue = -1,
  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(initValue <= 1 && initValue >= -1,
          'The value range of initValue of the sliding track is a floating point number from -1.0 to 1.0 .'),
      assert((maxValue <= 1) && maxValue >= minValue,
          'The maxValue of the sliding track is in the range of -1.0 to 1.0 .'),
      assert((minValue >= -1) && minValue <= maxValue,
          'The minValue of the sliding track is in the range of -1.0 to 1.0 .'),
      assert(initValue >= minValue && initValue < maxValue,
          'The initial value of the sliding track must be between the maximum value and the minimum value.');