LuckyGrid class final

九宫格抽奖 Widget;例如 LuckyGrid(config: config, width: 300, height: 300)。

Inheritance

Constructors

LuckyGrid({Key? key, required GridConfig config, GridController? controller, double? width, double? height, AlignmentGeometry alignment = Alignment.topLeft, VoidCallback? onStart, LuckyButtonTapCallback? onButtonTap, ValueChanged<int>? onCellTap, ValueChanged<LuckyResult<GridPrize>>? onEnd, ValueChanged<LuckyPhase>? onPhaseChanged, ValueChanged<int>? onActiveChanged, ValueChanged<LuckyImageError>? onImageError, VoidCallback? onReady, LuckyHooks hooks = const LuckyHooks(), List<LuckyLayer<GridLayout, GridFrame>> layers = const [], LuckyRenderer<GridConfig, GridLayout, GridFrame, LuckyResult<GridPrize>>? renderer, Widget overlayBuilder(BuildContext context, LuckySurfaceData<GridConfig, GridLayout, GridFrame> data)?, LuckyPerformanceOptions performance = const LuckyPerformanceOptions(), LuckyTextScaling textScaling = LuckyTextScaling.none, String? semanticsLabel, String semanticsValueBuilder(LuckyPhase, LuckyResult<GridPrize>?)?})
创建九宫格;点击按钮通过 onStart 交给调用方决定何时开始。
const

Properties

alignment → AlignmentGeometry
非正方形容器对齐。
final
config → GridConfig
九宫格不可变配置。
final
controller → GridController?
外部控制器,由调用方释放;未提供时宿主创建。
final
hashCode → int
The hash code for this object.
no setterinherited
height → double?
逻辑高度;未指定时父约束须有界。
final
hooks → LuckyHooks
初始化、绘制及尺寸钩子。
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
layers → List<LuckyLayer<GridLayout, GridFrame>>
插入指定绘制位置的扩展层。
final
onActiveChanged → ValueChanged<int>?
高亮奖品下标变化时调用。
final
onButtonTap → LuckyButtonTapCallback?
所有阶段点击按钮时调用,携带按钮下标与阶段。
final
onCellTap → ValueChanged<int>?
点击奖品格时调用。
final
onEnd → ValueChanged<LuckyResult<GridPrize>>?
正常或取消结束时调用。
final
onImageError → ValueChanged<LuckyImageError>?
图片请求失败时调用。
final
onPhaseChanged → ValueChanged<LuckyPhase>?
运动阶段变化时调用。
final
onReady → VoidCallback?
所有图片请求均有结论时调用。
final
onStart → VoidCallback?
可开始阶段点击按钮时调用,不自动开始。
final
overlayBuilder → Widget Function(BuildContext context, LuckySurfaceData<GridConfig, GridLayout, GridFrame> data)?
在渲染表面上构建可选奖品 Widget 层;data 提供已应用的布局、帧及通知器。
final
performance → LuckyPerformanceOptions
缓存、采样及隐藏暂停策略。
final
renderer → LuckyRenderer<GridConfig, GridLayout, GridFrame, LuckyResult<GridPrize>>?
可替换渲染后端;null 使用 Canvas。
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticsLabel → String?
无障碍标签;null 使用奖品数量描述。
final
semanticsValueBuilder → String Function(LuckyPhase, LuckyResult<GridPrize>?)?
阶段和结果的无障碍描述。
final
textScaling → LuckyTextScaling
是否跟随系统文字缩放。
final
width → double?
逻辑宽度;未指定时父约束须有界。
final

Methods

build(BuildContext context) → Widget
使用通用宿主提供时间源、图片和语义。
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited