Hi,
I am using Firebase to query a collection of documents and return them as a component variable. The variable is a list of Data(location_types). The documents are formatted to be location_types as well. The location_type is fairly straightforward, name: string, isPrimary: boolean, orderBy: integer. Once I have the list of documents in the variable, I then use this in 2 different row widgets with dynamic children. In one row, I want to show all the items in a text widget where they are isPrimary=false, and in the other row I want to show all the items that are isPrimary=true. I have this working, however, I want to put a comma between each text widget and at the end of the list I want to put a period, and I am attempting to do that as a text combine. I can get the commas to work without a problem. However, I can't seem to figure out how to detect the last item in the dynamic children list. If I use the length of the component variable, it will be incorrect, since I am filtering the values in each dynamic child. How do I get the length of each dynamic child? Is there a better way to do this?
Trying to get the total number of items in a dynamic children list
Widgets & Design
Googled, searched the forums and tried using ChatGPT (no help).
Yes
2
2 replies