Flutter | Iterate through a firebase collection
Prerequisites
Dec 17, 2021
- The project connected to firebase
- Cloud firestore and firebase core packages imported
Let's Begin…
Suppose you have a collection named users, we will create an instance for it as shown below
Below is a simple code to iterate through a collection
Note: You can also print field values using this,
print(doc[“field name”])
IF YOU WANT TO KNOW HOW TO ACCESS A SPECIFIC DOCUMENT INSIDE A COLLECTION, VISIT THE BELOW LINK
https://mwaseemaw.medium.com/flutter-firebase-getting-document-data-2c13e84d2dc9
Hope this blog has helped you with understanding about firebase collection