I need help fetching data from my Firebase Database as a 3 dimensional List. #9975
Unanswered
saurabhdhingra
asked this question in
Q&A
Replies: 1 comment
-
I fixed it myself. Grateful to anyone who worked on this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The function I am using to fetch my data
The "Date" class
The "Work" class
Firebase Cloud Firestore database
A diagram representing my database

The output of the print statement.
flutter: [[[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [Instance of 'Work'], [], [], [Instance of 'Work'], [], []], [[], [], [], [], [], [], []]]
But when I print the final output it is an empty list.
flutter: []
I have worked with a similar function on the same project.
This works well. I think the await function is so lengthy that flutter simply returns the empty list I declared in the function.
I was expecting the output that that the print statement inside the function returns.
flutter: [[[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [], [], [], [], [], []], [[], [Instance of 'Work'], [], [], [Instance of 'Work'], [], []], [[], [], [], [], [], [], []]]
Beta Was this translation helpful? Give feedback.
All reactions