CapsuleConfig class final
扭蛋机配置;例如 const CapsuleConfig(capsulesPerPrize: 3)。
- Annotations
Constructors
-
CapsuleConfig({List<
CapsulePrize> prizes = const [], List<int> ? capsules, int capsulesPerPrize = 3, CapsuleOptions options = const CapsuleOptions(), CapsuleStyle style = const CapsuleStyle()}) -
创建不可变配置;列表由调用方保持不可变。
const
Properties
-
capsules
→ List<
int> ? -
球内胶囊对应奖品下标;空时按每奖数量生成。
final
- capsulesPerPrize → int
-
每种奖品的默认胶囊数量。
final
- hashCode → int
-
与字段值一致的哈希。
no setteroverride
- options → CapsuleOptions
-
布局和动画参数。
final
-
prizes
→ List<
CapsulePrize> -
奖品列表,每种奖品一种配色。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → CapsuleStyle
-
外观配置。
final
Methods
-
copyWith(
{List< CapsulePrize> ? prizes, List<int> ? capsules, int? capsulesPerPrize, CapsuleOptions? options, CapsuleStyle? style}) → CapsuleConfig -
返回替换非空参数的副本,例如
value.copyWith()保留全部字段。 -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
按字段值比较,列表按内容比较。
override