Read method

  1. @override
Future<Map<String, dynamic>> Read(
  1. Type model,
  2. String docId
)
override

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;
}