Reputation: 9
DataCell( //ToDo: Calculate the total price for all items
Text(items.fold(0, (previousValue, element) => previousValue + element.itemPrice).toString() ), )
Upvotes: 0
Views: 85
Reputation: 12693
Try specifying the datatype of previousValue
Like so:
items.fold<double>(0, (previousValue, element) => previousValue + element)
Upvotes: 1