Search with multiple page state variables

Database & APIs

I want to allow my users to search within a ListView and have successfully set up the following:

I have a TextField with an action that sets a Page State Variable on submit. A Cancel Button clears both the text and the variable. In the query for the ListView, I have added a filter based on this Page State Variable, along with my other filters (hence using AND). To ensure that all items matching the other filters are displayed when no search is performed, I have enabled Ignore Empty Filter Values.

Now, I want to filter by an additional field using a Dropdown, which sets another Page State Variable. In the ListView Query, I added this new Page State Variable as a filter in the same way, kept Ignore Empty Filter Values enabled and deployed the Firestore Indexes again.

Unfortunately, the search/filtering stops working as soon as any Page State Variable is set, meaning the list remains unchanged.

Does anyone know how I can implement the search in a simple and efficient way, or if there is a general issue when multiple initially empty filters are used?

(I can't really use the "Simple Search" function in this case because my Dropdown is based on a Query to determine the option labels.)

What have you tried so far?
  • tried only one of the filters

  • set the dropdown value directly from the widget state

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