r/FlutterFlow • • 16d ago

I created this app in flutter flow but now facing this error in test mode. Kindly if anyone know the solution share in comment section. My whole hardwork struggle stuck.

Post image
1 Upvotes

3 comments sorted by

2

u/bramantec 15d ago

Given that I only have a photo to go on and it’s not very clear I’m essentially making an educated guess. That said, the red box labeled "Unexpected null value" usually indicates that a widget is trying to read a field that happens to be null at that moment. Based on what I can discern from the image, the issue lies below the list: it’s the widget that follows "Recent expenses," not the list itself. Try these three checks:

  • First, open your expense documents in Firestore and verify that every document contains all the fields you’re using (date, category, amount) and that they are formatted correctly ((sometimes an accidental space in a field name is enough to make it read as null).
  • Second, set a default value for any Text or other widget linked to those fields; this way an empty field won’t cause the entire page to crash.
  • Third, try running the app locally ("Local Run"); the debug console should display the name of the specific widget that is failing. Additionally, the fact that it shows "Number of Expenses: 0" even though there are three expenses in the list suggests that the counter might be reading a variable that was never assigned a value.

1

u/Desperate_Fishing265 15d ago

Simply put - something in that box is referring to a variable which is not having any value from the backend - so resolve the issue from backend first. Check the results from API call, or collection etc. manually first.