displaying data from subcollection related to parent in same listview

I have my firestore data like this with a "birds" collection, then a "behaviors" subcollection.

Collection: birds
  | -- display_name
  | -- website, etc.
  | -- Collection: behaviors
         | -- behavior-january
         | -- behavior-february
         | -- behavior-march, etc.

I have a dropdown on a page to select a month. I have a listview on the page with two text fields in it. I want the 1st text box to show the bird display_name and the 2nd one to show the behavior-month based on what's selected in the dropdown.

I looked at this article that shows a way to do it when going to a new page and passing the parent collection reference as a variable.

https://docs.flutterflow.io/data-and-backend/firebase/firestore-database/creating-subcollections

But I don't see how I can do it on the same page. I want to have some logic like:

if (dropdownMonth.text == january)
    {textBehavior.text == behavior_text field from behavior-jaunary document}

Any suggestions for making this work? Do I need to use a custom function to do it?

Thanks!

Craig

15 replies