WheelWidget constructor
const
WheelWidget({
- Key? key,
- required List<
WheelSegment> segments, - double? wheelSize = 300,
- double? animationSpeed,
- bool? showSpinButton = true,
- bool? showPointer = true,
- double? pointerOffset = 16,
- double? spinButtonOffset = 16,
- bool? removeSpinButtonOffset = false,
- Color? pointerColor = Colors.black,
- bool? animatePointerColor = true,
- void onFinish(
- WheelSegment result
- bool? enableTapToSpin = true,
- bool? showCenterDot = true,
- bool? showWheelBorder = false,
- Color? wheelBorderColor = Colors.white,
- double? wheelBorderWidth = 4.0,
- TextStyle? segmentTextStyle = const TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold),
- double? segmentFontSize = 18,
- FontWeight? segmentFontWeight = FontWeight.bold,
- Color? segmentTextColor = Colors.white,
- bool? showWheelShadow = true,
- double? wheelShadowBlur = 20.0,
- double? wheelShadowOffsetX = 0,
- double? wheelShadowOffsetY = 10.0,
- Color? wheelShadowColor = Colors.black26,
- String? spinButtonText = 'Spin!',
- TextStyle? spinButtonTextStyle = const TextStyle(fontSize: 18, color: Colors.white),
- Color? spinButtonColor = Colors.blue,
- Widget? spinButtonIcon = const Icon(Icons.arrow_forward),
- Curve? spinCurve = Curves.easeOutQuart,
- double? initialAngle = 2 * pi,
- double? segmentGap = 0.0,
- Widget? centerWidget,
- void onSpinning(
- double progress
- Widget? customSpinButton,
- Widget? customPointer,
- VoidCallback? onSpinStart,
- 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,
});