totalPrice method

double totalPrice(
  1. List<double> taxRates
)

Calculates the total price of a QuickbooksProduct for a list of taxRates

Returns only the price if taxable is false

Implementation

double totalPrice(List<double> taxRates) {
  if (taxable != true || price == null || price == 0 || taxRates.isEmpty) {
    return price ?? 0;
  }

  double totalPrice = price!;

  for (var taxRate in taxRates) {
    totalPrice += calculateTaxe(taxRate);
  }

  return totalPrice;
}