I'm working with a Firestore structure where I have a Restaurant
collection, and within that, an Orders
subcollection. Each order document contains a cartlist
field, which is an array of document references pointing to items in the Menu
subcollection.
I'm trying to loop through all the Orders
in FlutterFlow, then within each order, loop through the cartlist
array and add each document reference from the cartlist
to a page state variable (like ordersList
).
So far, I've set up the outer loop to go through the Orders
and increment an ordersLoopIndex
. Inside that, I need a nested loop to go through each cartlist
, but I'm struggling with the exact steps to properly add each document reference to my ordersList
page state.
What is the best way to handle this kind of nested loop for an array of document references in Firestore, and how do I store these references in a page state without using filtering or sorting options? Any help would be appreciated!