copyWith method

LuckyImageSlot copyWith({
  1. String? group,
  2. int? itemIndex,
  3. int? imageIndex,
  4. bool? active,
})

返回只替换指定字段的副本;参数为 null 时保留原值。

例如 slot.copyWith(active: true) 切换到同一槽位的激活图。

Implementation

LuckyImageSlot copyWith(
        {String? group, int? itemIndex, int? imageIndex, bool? active}) =>
    LuckyImageSlot(group ?? this.group, itemIndex ?? this.itemIndex,
        imageIndex ?? this.imageIndex,
        active: active ?? this.active);