markMessagesAsRead method
dynamic
markMessagesAsRead()
mark all messages as read this will be called when the chat conversation or chat builder is called so that all unread messages are marked as read
Implementation
markMessagesAsRead() async {
/// TODO IMP 1:
/// Ye function Update Karna hai
try {
customPrint('Marking $chatId as read from $currentUserId');
await chatCollectionReference.doc(chatId).update({
'unreadCount_$currentUserId': 0,
});
} catch (e) {
customPrint(
'Error in catch block ..could not mark as read.$currentUserId... $e',
);
}
}