LuckyNumberWheel constructor

const LuckyNumberWheel({
  1. Key? key,
  2. required NumberWheelConfig config,
  3. NumberWheelController? controller,
  4. LuckyRenderer<NumberWheelConfig, NumberWheelLayout, NumberWheelFrame, LuckyResult<NumberWheelPocket>>? 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<NumberWheelPocket>>? onEnd,
  12. ValueChanged<LuckyPhase>? onPhaseChanged,
  13. ValueChanged<int>? onPocketPassed,
  14. ValueChanged<LuckyImageError>? onImageError,
  15. VoidCallback? onReady,
  16. LuckyHooks hooks = const LuckyHooks(),
  17. List<LuckyLayer<NumberWheelLayout, NumberWheelFrame>> layers = const [],
  18. LuckyPerformanceOptions performance = const LuckyPerformanceOptions(),
  19. LuckyTextScaling textScaling = LuckyTextScaling.none,
  20. String? semanticsLabel,
  21. String semanticsValueBuilder(
    1. LuckyPhase phase,
    2. LuckyResult<NumberWheelPocket>? result
    )?,
})

创建组件;宽高为空时使用有界父约束,点按开始只通知回调。

Implementation

const LuckyNumberWheel(
    {super.key,
    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.onPocketPassed,
    this.onImageError,
    this.onReady,
    this.hooks = const LuckyHooks(),
    this.layers = const [],
    this.performance = const LuckyPerformanceOptions(),
    this.textScaling = LuckyTextScaling.none,
    this.semanticsLabel,
    this.semanticsValueBuilder});