updateData method
Implementation
Future<bool> updateData({
required String collection,
required String? id,
required Map<String, dynamic> data,
bool isErrorDialog = true,
void Function(FirebaseException firebaseException)? onError,
}) async {
// try {
return await _firestore
.collection(collection)
.doc(id)
.update(data)
.then((value) => true)
.catchError((error) async {
if (isErrorDialog) {
GetxFire.openDialog.messageError(error.message.toString(),
title: error.code.toString());
} else {
await GetxFire.hideProgressHud();
}
if (onError != null) onError(error);
return false;
});
// } catch (e) {
// GetxFire.openDialog.messageError(e.toString());
// return false;
// }
}