getAppointUnreadCount method

Future<int> getAppointUnreadCount({
  1. required List<String> appointIds,
})

Implementation

Future<int> getAppointUnreadCount({required List<String> appointIds}) {
  return checkResult(ChatSDKEvent.getAppointUnreadCount, () async {
    int unreadCount = 0;
    List<Conversation>? list =
        await Client.getInstance.chatManager.loadAllConversations();
    for (var conversation in list) {
      if (appointIds.contains(conversation.id)) {
        unreadCount += await conversation.unreadCount();
      }
    }
    return unreadCount;
  });
}