LuckyGameView<C extends Object, L extends LuckyLayout, F extends LuckyFrame, R extends LuckyResult<Object?>> constructor

const LuckyGameView<C extends Object, L extends LuckyLayout, F extends LuckyFrame, R extends LuckyResult<Object?>>({
  1. Key? key,
  2. required LuckyGame<C, L, F, R> game,
  3. required C config,
  4. LuckyController<C, L, F, R>? controller,
  5. LuckyRenderer<C, L, F, R>? renderer,
  6. double? width,
  7. double? height,
  8. AlignmentGeometry alignment = Alignment.topLeft,
  9. VoidCallback? onStart,
  10. LuckyButtonTapCallback? onButtonTap,
  11. ValueChanged<int>? onItemTap,
  12. ValueChanged<R>? onEnd,
  13. ValueChanged<LuckyPhase>? onPhaseChanged,
  14. void onItemPassed(
    1. int reel,
    2. int index
    )?,
  15. ValueChanged<LuckyImageError>? onImageError,
  16. VoidCallback? onReady,
  17. LuckyHooks hooks = const LuckyHooks(),
  18. List<LuckyLayer<L, F>> layers = const [],
  19. LuckyPerformanceOptions performance = const LuckyPerformanceOptions(),
  20. LuckyTextScaling textScaling = LuckyTextScaling.none,
  21. String? semanticsLabel,
  22. String semanticsValueBuilder(
    1. LuckyPhase phase,
    2. R? result
    )?,
})

创建宿主;未给宽高时要求父约束有界,外部控制器归调用者释放。

Implementation

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