updateData method
Updates data in a specified document within a collection.
The collectionName specifies the collection and docName specifies the document
to be updated. The data is the map containing the data to be updated.
Prints the outcome of the operation.
Implementation
Future<void> updateData(
String collectionName, String docName, Map<String, dynamic> data) async {
return await obj
.collection(collectionName)
.doc(docName)
.update(data)
.then((value) => print("Data Updated"))
.catchError((error) => print("Failed to update data: $error"));
}