Home > Net >  I am getting The operator ' ' can't be unconditionally invoked because the receiver c
I am getting The operator ' ' can't be unconditionally invoked because the receiver c

Time:01-15

DataCell( //ToDo: Calculate the total price for all items

Text(items.fold(0, (previousValue, element) => previousValue element.itemPrice).toString() ), )

CodePudding user response:

Try specifying the datatype of previousValue

Like so:

 items.fold<double>(0, (previousValue, element) => previousValue   element)

  •  Tags:  
  • Related