My code is written like this, but I cannot access the data in the output I get?
void getMessages() async {
final messages = await _firestore.collection('mesajlar').get();
for (var message in messages.docs) {
print(message.data);
}
}

The problem is that you are calling data as a property when it is actually a function, you can see that in the documentation for DocumentSnapshot, which QueryDocumentSnapshot implements. So all you have to change is the print:
print(message.data());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With