ModWheelSlider.customWidget constructor

const ModWheelSlider.customWidget({
  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 = 10,
  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. required List<Widget>? children,
  18. Widget? background,
  19. bool enableHapticFeedback = true,
  20. ModHapticFeedbackType hapticFeedbackType = ModHapticFeedbackType.vibrate,
  21. bool showPointer = true,
  22. Widget? customPointer,
  23. ScrollPhysics? scrollPhysics,
  24. bool allowPointerTappable = true,
  25. bool enableAnimation = true,
  26. Duration animationDuration = const Duration(seconds: 1),
  27. Curve animationType = Curves.easeIn,
  28. FixedExtentScrollController? controller,
  29. ModWheelSliderController? sliderController,
})

Constructs a ModWheelSlider with custom child widgets.

Implementation

const ModWheelSlider.customWidget({
  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 = 10,
  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,
  required this.children,
  this.background,
  this.enableHapticFeedback = true,
  this.hapticFeedbackType = ModHapticFeedbackType.vibrate,
  this.showPointer = true,
  this.customPointer,
  this.scrollPhysics,
  this.allowPointerTappable = true,
  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.custom,
      lineColor = null,
      selectedNumberStyle = null,
      unSelectedNumberStyle = null,
      selectedNumberWidth = null,
      currentIndex = null,
      interval = 1;