initializeLoggedInUser method

dynamic initializeLoggedInUser()

Implementation

initializeLoggedInUser() async {
  if (loggedInUser == null) {
    loggedInUser = await CometChat.getLoggedInUser();
    String id;
    String conversationType;
    if (user != null) {
      id = user!.uid;
      conversationType = ConversationType.user;
    } else {
      id = group!.guid;
      conversationType = ConversationType.group;
    }
    _conversation ??= (await CometChat.getConversation(id, conversationType,
        onSuccess: (conversation) {
      if (conversation.lastMessage != null) {}
    }, onError: (_) {}));
    _conversationId ??= _conversation?.conversationId;
    update();
  }
}