LuckyGrid constructor

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

创建九宫格;点击按钮通过 onStart 交给调用方决定何时开始。

Implementation

const LuckyGrid(
    {super.key,
    required this.config,
    this.controller,
    this.width,
    this.height,
    this.alignment = Alignment.topLeft,
    this.onStart,
    this.onButtonTap,
    this.onCellTap,
    this.onEnd,
    this.onPhaseChanged,
    this.onActiveChanged,
    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});