copyWith method

SlotPrize copyWith({
  1. LuckyFill? background,
  2. double? borderRadius,
  3. List<LuckyText>? texts,
  4. List<LuckyImage>? images,
  5. double? weight,
  6. bool? disabled,
  7. SlotCellPainter? painter,
})

返回仅替换非 null 参数的副本;例如 value.copyWith() 保留全部配置。

Implementation

SlotPrize copyWith(
        {LuckyFill? background,
        double? borderRadius,
        List<LuckyText>? texts,
        List<LuckyImage>? images,
        double? weight,
        bool? disabled,
        SlotCellPainter? painter}) =>
    SlotPrize(
        background: background ?? this.background,
        borderRadius: borderRadius ?? this.borderRadius,
        texts: texts ?? this.texts,
        images: images ?? this.images,
        weight: weight ?? this.weight,
        disabled: disabled ?? this.disabled,
        painter: painter ?? this.painter);