Update method

  1. @override
Future<bool> Update(
  1. IModelRF model,
  2. String docId
)
override

Implementation

@override
Future<bool> Update(IModelRF model, String docId) async {
  String tablename = model.runtimeType.toString();
  Map<String, dynamic> data = model.getJson();
  for (var entry in data.entries) {
    debugPrint(entry.value);
  }
  _db.collection(tablename).doc(tablename).update(data).then((value) {
    debugPrint("DocumentSnapshot successfully updated! ${data.values}");
    return true;
  }, onError: (e) {
    debugPrint("Error updating document $e");
    return false;
  });
  return false;
}