copyWith method
CapsulePrize
copyWith({
- LuckyFill? topFill,
- LuckyFill? bottomFill,
- List<
LuckyText> ? texts, - List<
LuckyImage> ? images, - double? weight,
- bool? disabled,
- CapsulePrizePainter? painter,
返回替换非空参数的副本,例如 value.copyWith() 保留全部字段。
Implementation
CapsulePrize copyWith(
{LuckyFill? topFill,
LuckyFill? bottomFill,
List<LuckyText>? texts,
List<LuckyImage>? images,
double? weight,
bool? disabled,
CapsulePrizePainter? painter}) =>
CapsulePrize(
topFill: topFill ?? this.topFill,
bottomFill: bottomFill ?? this.bottomFill,
texts: texts ?? this.texts,
images: images ?? this.images,
weight: weight ?? this.weight,
disabled: disabled ?? this.disabled,
painter: painter ?? this.painter);