setChatStatus method

dynamic setChatStatus()

Implementation

setChatStatus() async {
  if (await AppUtils.isNetConnected()) {
    if (profile.isGroupProfile.checkNull()) {
      debugPrint("value--> show group list");
      if (typingList.isNotEmpty) {
        userPresenceStatus(
            "${ProfileDetails(jid: typingList.last).getUsername()} ${AppConstants.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(Constants.emptyString);
                userPresenceStatus(lastSeen.toString());
              } else {
                groupParticipantsName(Constants.emptyString);
                userPresenceStatus(Constants.emptyString);
              }
            });
      } else {
        groupParticipantsName(Constants.emptyString);
        userPresenceStatus(Constants.emptyString);
      }
    }
  } else {
    userPresenceStatus(Constants.emptyString);
  }
}