WheelWidget constructor

const WheelWidget({
  1. Key? key,
  2. required List<WheelSegment> segments,
  3. double? wheelSize = 300,
  4. double? animationSpeed,
  5. bool? showSpinButton = true,
  6. bool? showPointer = true,
  7. double? pointerOffset = 16,
  8. double? spinButtonOffset = 16,
  9. bool? removeSpinButtonOffset = false,
  10. Color? pointerColor = Colors.black,
  11. bool? animatePointerColor = true,
  12. void onFinish(
    1. WheelSegment result
    )?,
  13. bool? enableTapToSpin = true,
  14. bool? showCenterDot = true,
  15. bool? showWheelBorder = false,
  16. Color? wheelBorderColor = Colors.white,
  17. double? wheelBorderWidth = 4.0,
  18. TextStyle? segmentTextStyle = const TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold),
  19. double? segmentFontSize = 18,
  20. FontWeight? segmentFontWeight = FontWeight.bold,
  21. Color? segmentTextColor = Colors.white,
  22. bool? showWheelShadow = true,
  23. double? wheelShadowBlur = 20.0,
  24. double? wheelShadowOffsetX = 0,
  25. double? wheelShadowOffsetY = 10.0,
  26. Color? wheelShadowColor = Colors.black26,
  27. String? spinButtonText = 'Spin!',
  28. TextStyle? spinButtonTextStyle = const TextStyle(fontSize: 18, color: Colors.white),
  29. Color? spinButtonColor = Colors.blue,
  30. Widget? spinButtonIcon = const Icon(Icons.arrow_forward),
  31. Curve? spinCurve = Curves.easeOutQuart,
  32. double? initialAngle = 2 * pi,
  33. double? segmentGap = 0.0,
  34. Widget? centerWidget,
  35. void onSpinning(
    1. double progress
    )?,
  36. Widget? customSpinButton,
  37. Widget? customPointer,
  38. VoidCallback? onSpinStart,
  39. VoidCallback? onSpinEnd,
})

Implementation

const WheelWidget({
  super.key,
  required this.segments,
  this.wheelSize = 300,
  this.animationSpeed,
  this.showSpinButton = true,
  this.showPointer = true,
  this.pointerOffset = 16,
  this.spinButtonOffset = 16,
  this.removeSpinButtonOffset = false,
  this.pointerColor = Colors.black,
  this.animatePointerColor = true,
  this.onFinish,
  this.enableTapToSpin = true,
  this.showCenterDot = true,
  this.showWheelBorder = false,
  this.wheelBorderColor = Colors.white,
  this.wheelBorderWidth = 4.0,
  this.segmentTextStyle = const TextStyle(
    color: Colors.white,
    fontSize: 18,
    fontWeight: FontWeight.bold,
  ),
  this.segmentFontSize = 18,
  this.segmentFontWeight = FontWeight.bold,
  this.segmentTextColor = Colors.white,
  this.showWheelShadow = true,
  this.wheelShadowBlur = 20.0,
  this.wheelShadowOffsetX = 0,
  this.wheelShadowOffsetY = 10.0,
  this.wheelShadowColor = Colors.black26,
  this.spinButtonText = 'Spin!',
  this.spinButtonTextStyle = const TextStyle(
    fontSize: 18,
    color: Colors.white,
  ),
  this.spinButtonColor = Colors.blue,
  this.spinButtonIcon = const Icon(Icons.arrow_forward),
  this.spinCurve = Curves.easeOutQuart,
  this.initialAngle = 2 * pi,
  this.segmentGap = 0.0,
  this.centerWidget,
  this.onSpinning,
  this.customSpinButton,
  this.customPointer,
  this.onSpinStart,
  this.onSpinEnd,
});