LuckyWheel constructor

const LuckyWheel({
  1. Key? key,
  2. required WheelConfig config,
  3. WheelController? controller,
  4. double? width,
  5. double? height,
  6. AlignmentGeometry alignment = Alignment.topLeft,
  7. VoidCallback? onStart,
  8. LuckyButtonTapCallback? onButtonTap,
  9. ValueChanged<LuckyResult<WheelPrize>>? onEnd,
  10. ValueChanged<LuckyPhase>? onPhaseChanged,
  11. ValueChanged<int>? onSectorPassed,
  12. ValueChanged<LuckyImageError>? onImageError,
  13. VoidCallback? onReady,
  14. LuckyHooks hooks = const LuckyHooks(),
  15. List<LuckyLayer<WheelLayout, WheelFrame>> layers = const [],
  16. LuckyRenderer<WheelConfig, WheelLayout, WheelFrame, LuckyResult<WheelPrize>>? renderer,
  17. Widget overlayBuilder(
    1. BuildContext context,
    2. LuckySurfaceData<WheelConfig, WheelLayout, WheelFrame> data
    )?,
  18. LuckyPerformanceOptions performance = const LuckyPerformanceOptions(),
  19. LuckyTextScaling textScaling = LuckyTextScaling.none,
  20. String? semanticsLabel,
  21. String semanticsValueBuilder(
    1. LuckyPhase phase,
    2. LuckyResult<WheelPrize>? result
    )?,
})

创建转盘,结构变化在减速期间延后到本局结束应用。

Implementation

const LuckyWheel(
    {super.key,
    required this.config,
    this.controller,
    this.width,
    this.height,
    this.alignment = Alignment.topLeft,
    this.onStart,
    this.onButtonTap,
    this.onEnd,
    this.onPhaseChanged,
    this.onSectorPassed,
    this.onImageError,
    this.onReady,
    this.hooks = const LuckyHooks(),
    this.layers = const [],
    this.renderer,
    this.overlayBuilder,
    this.performance = const LuckyPerformanceOptions(),
    this.textScaling = LuckyTextScaling.none,
    this.semanticsLabel,
    this.semanticsValueBuilder});