ModWheelSlider.number constructor

const ModWheelSlider.number({
  1. Key? key,
  2. double horizontalListHeight = 50,
  3. double horizontalListWidth = double.infinity,
  4. double verticalListHeight = 400.0,
  5. double verticalListWidth = 50.0,
  6. required int totalCount,
  7. required num initValue,
  8. required dynamic onValueChanged(
    1. dynamic
    ),
  9. double itemSize = 40,
  10. double perspective = 0.0007,
  11. bool isInfinite = true,
  12. bool horizontal = true,
  13. double squeeze = 1.0,
  14. Color pointerColor = Colors.black,
  15. double pointerHeight = 50.0,
  16. double pointerWidth = 3.0,
  17. Widget? background,
  18. bool enableHapticFeedback = true,
  19. ModHapticFeedbackType hapticFeedbackType = ModHapticFeedbackType.vibrate,
  20. bool showPointer = false,
  21. Widget? customPointer,
  22. TextStyle? selectedNumberStyle = const TextStyle(fontWeight: FontWeight.bold),
  23. TextStyle? unSelectedNumberStyle = const TextStyle(),
  24. double? selectedNumberWidth,
  25. required num? currentIndex,
  26. ScrollPhysics? scrollPhysics,
  27. bool allowPointerTappable = true,
  28. num interval = 1,
  29. bool enableAnimation = true,
  30. Duration animationDuration = const Duration(seconds: 1),
  31. Curve animationType = Curves.easeIn,
  32. FixedExtentScrollController? controller,
  33. ModWheelSliderController? sliderController,
})

Constructs a ModWheelSlider with numbered UI.

Implementation

const ModWheelSlider.number({
  super.key,
  this.horizontalListHeight = 50,
  this.horizontalListWidth = double.infinity,
  this.verticalListHeight = 400.0,
  this.verticalListWidth = 50.0,
  required this.totalCount,
  required this.initValue,
  required this.onValueChanged,
  this.itemSize = 40,
  this.perspective = 0.0007,
  this.isInfinite = true,
  this.horizontal = true,
  this.squeeze = 1.0,
  this.pointerColor = Colors.black,
  this.pointerHeight = 50.0,
  this.pointerWidth = 3.0,
  this.background,
  this.enableHapticFeedback = true,
  this.hapticFeedbackType = ModHapticFeedbackType.vibrate,
  this.showPointer = false,
  this.customPointer,
  this.selectedNumberStyle = const TextStyle(fontWeight: FontWeight.bold),
  this.unSelectedNumberStyle = const TextStyle(),
  this.selectedNumberWidth,
  required this.currentIndex,
  this.scrollPhysics,
  this.allowPointerTappable = true,
  this.interval = 1,
  this.enableAnimation = true,
  this.animationDuration = const Duration(seconds: 1),
  this.animationType = Curves.easeIn,
  this.controller,
  this.sliderController,
})  : assert(perspective <= 0.01, 'perspective must be <= 0.01'),
      _sliderType = _WheelSliderType.number,
      lineColor = null,
      children = null;