update method

Future<void> update({
  1. String? docId,
  2. required Map<String, Object?> data,
})

update specific fields in your model call update by pass data user.update(data: { "first_name": "Mohamed", "last_name": "Abdullah" }) update specific model use update by pass docId and data FirestoreModel.use

Implementation

Future<void> update(
    {String? docId, required Map<String, Object?> data}) async {
  this.isUpdating = true;
  return await _collectionReference
      .doc(docId ?? this.docId)
      .update(_dataMap(map: data))
      .then((value) => this.isUpdating = false);
}