totalValue static method
Implementation
static double totalValue(List<CartItemModel> items) {
if (items.isEmpty) return 0;
var value = items
.map((item) =>
item.amount! *
((item.product != null) && (item.product!.price != null)
? item.product!.price!
: 0.0))
.reduce((value, element) => value + element);
return value.toDouble();
}