setChatStatus method

dynamic setChatStatus()

Implementation

setChatStatus() async {
  if (profile.isGroupProfile.checkNull()) {
    debugPrint("value--> show group list");
    if (typingList.isNotEmpty) {
      userPresenceStatus(
          "${ProfileDetails(jid: typingList.last).getUsername()} typing...");
      //"${Member(jid: typingList.last).getUsername()} typing...");
    } else {
      getParticipantsNameAsCsv(profile.jid.checkNull());
    }
  } else {
    if (!profile.isBlockedMe.checkNull() ||
        !profile.isAdminBlocked.checkNull()) {
      Mirrorfly.getUserLastSeenTime(
          jid: profile.jid.toString(),
          flyCallBack: (FlyResponse response) {
            debugPrint("date time flutter--->");
            if (response.isSuccess && response.hasData) {
              var lastSeen = convertSecondToLastSeen(response.data);
              groupParticipantsName('');
              userPresenceStatus(lastSeen.toString());
            } else {
              groupParticipantsName('');
              userPresenceStatus("");
            }
          });
    } else {
      groupParticipantsName('');
      userPresenceStatus("");
    }
  }
  if (!await AppUtils.isNetConnected()) {
    debugPrint("setChatStatus method network not connected");
    userPresenceStatus("");
  }
}