subtotal property
double
get
subtotal
This method is called when we have to get the Total amount
Implementation
double get subtotal {
return _cartItemsList.fold(0, (sum, item) {
return sum +
item.variants.fold(
0,
(variantSum, variant) =>
variantSum + (variant.price * item.quantity),
);
});
}