1final _fireStore = FirebaseFirestore.instance;
2Future<void> getData() async {
3 // Get docs from collection reference
4 QuerySnapshot querySnapshot = await _fireStore.collection('collectionName').get();;
5
6 // Get data from docs and convert map to List
7 final allData = querySnapshot.docs.map((doc) => doc.data()).toList();
8 //for a specific field
9 final allData =
10 querySnapshot.docs.map((doc) => doc.get('fieldName')).toList();
11
12 print(allData);
13}
14