addProduct method

void addProduct({
  1. required Product product,
  2. double? amount,
  3. int? quantity,
})

Adds a product to the EAEstimate instance

Implementation

void addProduct({required Product product, double? amount, int? quantity}) {
  if (product.payload[EAPropertyKey.PRODUCT_AMOUNT] == null && amount != null)
    product.setAmount(amount);
  if (product.payload[EAPropertyKey.PRODUCT_QUANTITY] == null &&
      quantity != null) product.setQuantity(quantity);

  _products.add(product);
  payload[EAPropertyKey.ESTIMATE_PRODUCTS] = _products;
}