LuckyCapsuleMachine constructor

const LuckyCapsuleMachine({
  1. Key? key,
  2. required CapsuleConfig config,
  3. LuckyController<CapsuleConfig, CapsuleLayout, CapsuleFrame, LuckyResult<CapsulePrize>>? controller,
  4. LuckyRenderer<CapsuleConfig, CapsuleLayout, CapsuleFrame, LuckyResult<CapsulePrize>>? renderer,
  5. double? width,
  6. double? height,
  7. AlignmentGeometry alignment = Alignment.topLeft,
  8. VoidCallback? onStart,
  9. LuckyButtonTapCallback? onButtonTap,
  10. ValueChanged<int>? onItemTap,
  11. ValueChanged<LuckyResult<CapsulePrize>>? onEnd,
  12. ValueChanged<LuckyPhase>? onPhaseChanged,
  13. ValueChanged<LuckyImageError>? onImageError,
  14. VoidCallback? onReady,
  15. LuckyHooks hooks = const LuckyHooks(),
  16. List<LuckyLayer<CapsuleLayout, CapsuleFrame>> layers = const [],
  17. LuckyPerformanceOptions performance = const LuckyPerformanceOptions(),
  18. LuckyTextScaling textScaling = LuckyTextScaling.none,
  19. String? semanticsLabel,
  20. String semanticsValueBuilder(
    1. LuckyPhase phase,
    2. LuckyResult<CapsulePrize>? result
    )?,
})

创建扭蛋机;参数契约与 LuckyGameView 一致。

Implementation

const LuckyCapsuleMachine(
    {super.key,
    required super.config,
    super.controller,
    super.renderer,
    super.width,
    super.height,
    super.alignment,
    super.onStart,
    super.onButtonTap,
    super.onItemTap,
    super.onEnd,
    super.onPhaseChanged,
    super.onImageError,
    super.onReady,
    super.hooks,
    super.layers,
    super.performance,
    super.textScaling,
    super.semanticsLabel,
    super.semanticsValueBuilder})
    : super(game: const CapsuleGame());