I was learning flutter from the book flutter projects by simone(published at packt).
and I found this code which is a little bit different from the book as some of the keywords are changed now(I guess).
Future testData() async {
print('here'); // I can see this in debug
FirebaseFirestore db = FirebaseFirestore.instance; // book says Firestore instead of FirebaseFirestore
print('now here'); // but I can't see this , So, I think there is some issue with above lines.
var data = await db.collection('event_details').get(); // it has getDocuments()
var details = data.docs.toList(); //it has documents instead of docs
details.forEach((d) {
print(d.id); // it has documentID rather than just id
});
}
The output should be the Id which looks something like this 'nasfs3rasfsd...'
please help where I am going wrong. and thanks for the help!! ^^