I need to add list of objects in firestore as shown in the images. i could only add two list with the below code
onPressed: () {
_fireStore.collection('notifyseller').document().updateData({
'Customer': userName,
"address": controller.text,
"mobile": mobileNumber,
"Item": FieldValue.arrayUnion([
{
"name": itemName.toList()[0],
"price": rate.toList()[0],
"quantity": quantity.toList()[0]
},
{
"name": itemName.toList()[1],
"price": rate.toList()[1],
"quantity": quantity.toList()[1]
},
]),
});
},
here itemName.toList() contains list of strings. by the above code i can only add two data. i need to add all the item in the itemName.toList() to that array, instead of giving index for each array
