LuckyGameView<C extends Object, L extends LuckyLayout, F extends LuckyFrame, R extends LuckyResult<Object?> > class
通用玩法宿主;例如传入自定义 game、config 和可选 controller。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LuckyGameView
- Implementers
Constructors
-
LuckyGameView({Key? key, required LuckyGame<
C, L, F, R> game, required C config, LuckyController<C, L, F, R> ? controller, LuckyRenderer<C, L, F, R> ? renderer, double? width, double? height, AlignmentGeometry alignment = Alignment.topLeft, VoidCallback? onStart, LuckyButtonTapCallback? onButtonTap, ValueChanged<int> ? onItemTap, ValueChanged<R> ? onEnd, ValueChanged<LuckyPhase> ? onPhaseChanged, void onItemPassed(int reel, int index)?, ValueChanged<LuckyImageError> ? onImageError, VoidCallback? onReady, LuckyHooks hooks = const LuckyHooks(), List<LuckyLayer< layers = const [], LuckyPerformanceOptions performance = const LuckyPerformanceOptions(), LuckyTextScaling textScaling = LuckyTextScaling.none, String? semanticsLabel, String semanticsValueBuilder(LuckyPhase phase, R? result)?})L, F> > -
创建宿主;未给宽高时要求父约束有界,外部控制器归调用者释放。
const
Properties
- alignment → AlignmentGeometry
-
非正方形容器的对齐。
final
- config → C
-
不可变配置。
final
-
controller
→ LuckyController<
C, L, F, R> ? -
外部控制器,null 时由宿主创建。
final
-
game
→ LuckyGame<
C, L, F, R> -
玩法策略。
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< L, F> > -
用户绘制层。
final
- onButtonTap → LuckyButtonTapCallback?
-
任意阶段的按钮点击。
final
-
onEnd
→ ValueChanged<
R> ? -
一局正常或作废结束。
final
-
onImageError
→ ValueChanged<
LuckyImageError> ? -
图片加载或转换失败。
final
- onItemPassed → void Function(int reel, int index)?
-
越过条目的列和下标。
final
-
onItemTap
→ ValueChanged<
int> ? -
条目点击。
final
-
onPhaseChanged
→ ValueChanged<
LuckyPhase> ? -
运动阶段变化。
final
- onReady → VoidCallback?
-
全部请求均有结论。
final
- onStart → VoidCallback?
-
命中按钮且当前允许开始时触发,不自动调用 play。
final
- performance → LuckyPerformanceOptions
-
缓存、采样及隐藏暂停策略。
final
-
renderer
→ LuckyRenderer<
C, L, F, R> ? -
可替换的渲染后端。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticsLabel → String?
-
无障碍标签,null 使用玩法默认。
final
- semanticsValueBuilder → String Function(LuckyPhase phase, R? result)?
-
无障碍阶段与结果描述,null 时不提供 value。
final
- textScaling → LuckyTextScaling
-
系统文字缩放策略。
final
- width → double?
-
可选逻辑宽度。
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< LuckyGameView< C, L, F, R> > -
创建通用宿主状态。
override
-
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