Read method
Implementation
@override
Future<Map<String, dynamic>> Read(Type model, String docId) async {
Map<String, dynamic> modelData = {};
String collectionname = model.toString();
_db.collection(collectionname).get().then((querySnapshot) {
for (var docSnapshot in querySnapshot.docs) {
modelData[docSnapshot.id] = docSnapshot.data();
}
return modelData;
}, onError: (e) {
debugPrint("Error completing: $e");
return modelData;
});
return modelData;
}