addCurrency method

dynamic addCurrency({
  1. required Currency currency,
  2. int quantity = 1,
})

Add a new Currency to the inventory or update the existing Currency inventory by increasing the amount by quantity

Implementation

addCurrency({required Currency currency, int quantity = 1}) {
  currencies.update(currency, (value) => value + quantity,
      ifAbsent: () => quantity);
}