I have a collection called market and it had two documents that I can confirm in firebase.
I am now trying to get the number of documents in that collection like this:-
getAllItemsForSell()async {
final snapshot = await Firestore.instance.collection('market').getDocuments();
final documents = snapshot?.documents;
print(documents); // []
}
The above function prints out '[]', what am I doing wrong? I looked everywhere on the internet but nothing seems to be helping.
please help? I am new to the Flutter Firebase world, thanks in advance.