copyWithStock method

InventoryState copyWithStock(
  1. String productId,
  2. int quantity
)

Implementation

InventoryState copyWithStock(String productId, int quantity) {
  return InventoryState({...stocks, productId: quantity});
}