iamshaunjp / flutter-firebase

All course files for the Flutter & Firebase tutorial playlist on The Net Ninja YouTube channel
580 stars 441 forks source link

Snapshot has no data, Loading widget is shown forever #3

Open om8007 opened 4 years ago

om8007 commented 4 years ago

I followed the tutorials thoroughly, but loading widget is shown infinitely. I printed a message in output before if statement and it shows that snapshot has no data and so it goes to else statement and shows loading widget infinitely.

your code https://github.com/iamshaunjp/flutter-firebase/blob/bf1a90852aacd2b9c35c700c154169fc55472655/brew_crew/lib/screens/home/settings_form.dart#L32

my code https://github.com/om8007/brew_crew/blob/2178e591785a00e12cf172a8d55cd8e49c503773/lib/screens/home/settings_form.dart#L28

output Screenshot (156)

This issue has been faced with some more coders as can be seen in comments for video 25

codingstark-dev commented 4 years ago

Ya definitely if you are using streambuilder in flutter then you might be Know about streambuilder build multiple times when some network or streams flow in userdata that's why! And share the full screenshot of error

flutternoob commented 4 years ago

I faced the same problem. My problem was with the userData getter in my database.dart file. I looked through your database.dart file and could not find any problem. Maybe I missed something. Compare your database.dart file with the tutorial database.dart file for this chapter. Do the same with the settings_form.dart file. Maybe that will help.

karan316 commented 4 years ago

Yes I am facing the same issue.

aishy123 commented 3 years ago

Im also facing the same issue pls come to my aid

sidra3814 commented 3 years ago

I changed the variable String sugars to int sugars everywhere in the code also in the sugars list. This resolved the error for me.

thawahsaw commented 2 years ago

anyone has solved this problem?

VishruthVS commented 11 months ago

yes, check it out here: https://github.com/VishruthVS/FlutterAuthentication