Home > OS >  print messages (data) from firebase cloud
print messages (data) from firebase cloud

Time:09-23

I want to get data from firebase cloud Data means my chatApp's messages.

like this I want to print messages on my screen

but in my code i got error see this arrow line in both images

android studio suggest me to add nullcheck(!) to

final messages = snapshot.data!.documents;

but it not working

CodePudding user response:

Try to add the null-check and fix your typo: messgeText => messageText.

CodePudding user response:

You r using Flutter 2.5.0 and now for the latest flutter version the syntax are changed for Firebase . Try this way:

               final message = snapshot.data!.data()
  • Related