checkConversationExists method

Future<bool> checkConversationExists(
  1. int attachmentsLength
)

Implementation

Future<bool> checkConversationExists(int attachmentsLength) async {
  try {
    ChatController chatController = Get.find<ChatController>();
    if (chatController.conversation.value == null) {
      await chatController.createNewConversation();
      if (chatController.conversation.value == null) {
        chatController.resetConversation();
        sendingAttachments.value -= attachmentsLength;
        update();
        return false;
      }
      return true;
    }
    return true;
  } catch (e) {
    return false;
  }
}