Мне нужно добавить список объектов в FireStore, как показано на изображениях. Я мог бы добавить только два списка с кодом ниже
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]
},
]),
});
},
здесь itemName.toList () содержит список строк. с помощью приведенного выше кода я могу добавить только две данные. мне нужно добавить все элементы в itemName.toList () к этому массиву, вместо того, чтобы давать индекс для каждого массива
