I have some data and i am simply printing it by forEach loop i need to calculate the price
Here is simple code
allRows.forEach((row) => print(row));
its printing like this
[ ] I/flutter (31845): {id: 1195, title: Fajita Pizza (S),color: Grey, price: 199.0, sizeselect: Small}
[ +1 ms] I/flutter (31845): {id: 1211, title: Tikka Pizza (M),color: Black, price: 349.0, sizeselect: Small}
what i need to do is i need to calculate or sum the price and print the values.
So expected output is 548
question from:
https://stackoverflow.com/questions/65872003/flutter-calculate-ammount-by-foreach-loop 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…