How to transform the data received from cloud_firestore into a Map
问题 The data from the cloud_firestore database is in the form of JSON. However, how to transform the data from JSON in a List of Map? The dummy data in my firestore 回答1: Data to List of Map: final CollectionReference ref = Firestore.instance.collection('food'); List<Map<String, dynamic>> listOfMaps = []; await ref.getDocuments().then((QuerySnapshot snapshot) { listOfMaps = snapshot.documents.map((DocumentSnapshot documentSnapshot) { return documentSnapshot.data; }).toList(); }); print(listOfMaps)