Filter when Generating children from variable containing 2 querys of lists of documents

Database & APIs

I have the following problem:

I have a firebase collection called "users" with a list of all the users of my app and i have a Firebase collection called "friends" containing, among other fields, a list named "user_combination". This list "user_combination" always contains 2 user references to refer to the both users who are friends with each other.

Now i have a page for adding new users to your friend list where i want to display all Users from the collection of users which are currently not a friend of mine.

I tried a lot of things, but cant make the filters work the way I wanted to. I hope someone can help me with this :)

What have you tried so far?

In the screenshot you can see my current "friends search" page where i currently list all users (or the searched ones) even those, who are already a friend of mine.

I tried the following to set the filters up:


I have a query on the scaffold on the Collection users, excluding my own user.



Then I have a query on the Conditional Builder for a list of documents with a filter to only include documents where the array "user_combination" contains my own user.


So what I have is 2 List of Documents:
First list is all the users expect my self. Second list is all the friend documents, where my self is part of the array "user_combination".

My current list view just generates all the users from the first query of all users (except my self).

But when trying to set up a filter for this case i get stuck in the options and menus that show up during that progress.
What I want sounds relativly simple to me:

Filter all User Docs from the query of users, where the User Reference is not included in the list "user_combination" of any friend item in my friend query.

Did you check FlutterFlow's Documentation for this topic?
Yes
1
5 replies