CapsuleOptions class final
扭蛋机几何与动画参数。
- Annotations
Constructors
- CapsuleOptions({double globeRadiusFactor = 0.42, double capsuleRadiusFactor = 0.14, Duration dropTime = const Duration(milliseconds: 600), Duration revealTime = const Duration(milliseconds: 400), bool revealOnSettle = true, LuckyMotionOptions motion = const LuckyMotionOptions(speed: 12, accelerationTime: Duration(milliseconds: 800), decelerationTime: Duration(milliseconds: 1500)), LuckyPhysics? physics})
-
创建不可变配置;列表由调用方保持不可变。
const
Properties
- capsuleRadiusFactor → double
-
胶囊半径相对球体半径的比例。
final
- dropTime → Duration
-
掉落时长,运行期至少一毫秒。
final
- globeRadiusFactor → double
-
球体半径相对盒子宽度的比例。
final
- hashCode → int
-
与字段值一致的哈希。
no setteroverride
- motion → LuckyMotionOptions
-
搅拌动画配置。
final
- physics → LuckyPhysics?
-
实验性(可能调整):物理碰撞模式参数;null 保持参数化轨迹(默认)。
final
- revealOnSettle → bool
-
是否在掉落后展开奖品卡。
final
- revealTime → Duration
-
展示时长,运行期至少一毫秒。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{double? globeRadiusFactor, double? capsuleRadiusFactor, Duration? dropTime, Duration? revealTime, bool? revealOnSettle, LuckyMotionOptions? motion, LuckyPhysics? physics}) → CapsuleOptions -
返回替换非空参数的副本,例如
value.copyWith()保留全部字段; 无法用 null 清除physics,需要关闭物理模式时重新构造。 -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withoutPhysics(
) → CapsuleOptions -
返回去掉物理模式、其余字段不变的副本,例如关闭
CapsuleOptions(physics: ...)。
Operators
-
operator ==(
Object other) → bool -
按字段值比较,列表按内容比较。
override