itemsRead method

dynamic itemsRead()

Implementation

itemsRead() async {
  if (await AppUtils.isNetConnected()) {
    selected(false);
    Mirrorfly.markConversationAsRead(selectedChats);
    var count = selectedChatsPosition.length;
    for (var element in selectedChatsPosition) {
      recentChats[element].isConversationUnRead = false;
      recentChats[element].unreadMessageCount = 0;
    }
    clearAllChatSelection();
    updateUnReadChatCount();
    // toToast("Chat${count > 1 ? 's' : ''} marked as read");
    if(count > 1){
      toToast(AppConstants.chatsMarkedAsRead);
    }else{
      toToast(AppConstants.chatMarkedAsRead);
    }

  } else {
    toToast(AppConstants.noInternetConnection);
  }
}