copyWith method

MoneyTransaction copyWith({
  1. DateTime? dateTime,
  2. String? description,
  3. ExpenseOrIncome? expenseOrIncome,
  4. String? id,
  5. MoneyTransactionMethod? method,
  6. Money? value,
})

Creates a copy of this MoneyTransaction instance where the only changes are those specified in the parameters of this method.

Implementation

MoneyTransaction copyWith({
  DateTime? dateTime,
  String? description,
  ExpenseOrIncome? expenseOrIncome,
  String? id,
  MoneyTransactionMethod? method,
  Money? value,
}) =>
    MoneyTransaction(
      dateTime: dateTime ?? this.dateTime,
      description: description ?? this.description,
      expenseOrIncome: expenseOrIncome ?? this.expenseOrIncome,
      id: id ?? this.id,
      method: method ?? this.method,
      value: value ?? this.value,
    );