Description of the Issue:
I am working on a FlutterFlow app, where I query a collection from Firestore based on the logged-in user and a date filter. The problem I'm facing is that when the query returns no results (for example, if the user hasn’t logged any data for that particular day or week), the page crashes. Alternatively, if I choose to hide the widget in case of no results, it hides the widget entirely, which is not ideal.
What I want to achieve:
When the query returns zero results, I want the page to not crash and the widgets to still display.
Instead of hiding the widget completely, I want it to display default values (e.g., default meal options or placeholder text) when no data is found, so that the user still sees something useful on the page.
I do not want to hide widgets or show errors when there’s no query data; rather, I want the widgets to display default values.
Current Behavior:
Option 1: When the query returns no results, the page crashes.
Option 2: If I select the hide widget option, the widget gets hidden, even if no data is returned.
What I’ve Tried:
Using the hide widget option in case of no results, but this hides the widget completely, which isn't what I want.
I want the widget to show default values when the query returns no results.
What I need help with:
How can I keep the page from crashing when the query has no results?
How can I display default values (or a placeholder) in the widget, even when the query returns empty results, without manually hiding the widget?