copyWith method

Dice copyWith({
  1. int? amount,
  2. int? sides,
  3. int? modifierValue,
  4. String? modifierSign,
  5. String? modifierStat,
})

If you want to change the modifier value, use copyWithModifierValue instead. Otherwise, use copyWith to change the modifier sign, as this class is immutable, and the sign is determined by the modifier value.

Implementation

Dice copyWith({
  int? amount,
  int? sides,
  int? modifierValue,
  String? modifierSign,
  String? modifierStat,
}) =>
    Dice(
      amount: amount ?? this.amount,
      sides: sides ?? this.sides,
      modifierSign: modifierSign ?? this.modifierSign,
      modifierValue: modifierValue ?? this.modifierValue,
      modifierStat: modifierStat ?? this.modifierStat,
    );