How to show a list of tags on cards within a list view

Database & APIs

My app concept is to provide users with 'quests' to go on (like mini adventures). I have a page called Quests where users can see all of the available quests in a list of 'quest cards'. Each card will show that individual quest's name, a series of 'hint tags', and some other information. The 'hint tags' are bits of information about the quest to help users decide if they're interested in doing that quest.

I'm using Firebase as my backend, and the relevant schema is as follows:

- [Collection] Quests
- {questId}
- name: string
- hints: array of references (Hints/{hintId})

- [Collection] Hints
- {hintId}
- name: string

I stored all of my Hints in a separate collection because I wanted a list of them that I could add to over time and reference within the quests.

The way I approached this was to put a backend query on my top level page scaffold querying the Quests collection and returning a list of documents. I then have a ListView that holds the Quest Cards. That list view is generating it's children dynamically using the results of the query on the Quests collection, so that each card in the list is an individual quest.

My issue is that I can't seem to figure out how to pull the list of Hints that are associated with each specific Quest. They're stored as references in the Quest documents, so I feel like this should be possible with this setup. The card have a wrap widget that is holding the tag, so if I can get the wrap widget to generate it's children dynamically, and have each child tag correspond to the hints that are referenced within that quest, then that should work.

ChatGPT said to query the Hints collection with a filter such as: Where Document ID is in [list_of_hintIDs_for_this_quest], but I can't figure out how to actually accomplish this within the FlutterFlow interface. Every time I try to set up the queries I get lost.

Thanks in advance for any assistance. I've tried my best to explain this clearly, but I'm happy to elaborate if anything isn't clear

What have you tried so far?

I've tried building out a query within the quest card that would query the Hints collection, and filter for only Hints that match the Hints in the quest. The issue here is that when I go to apply the filter, the documentId is not available, I only have the Hint name to filter on, but that's not what is being stored in the Quest document, it's the Hint document reference.

Did you check FlutterFlow's Documentation for this topic?
Yes
4
2 replies