Profile.fromJson constructor

Profile.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Profile.fromJson(Map<String, dynamic> json) => Profile(
      contactType: json["contactType"] == "unknown"
          ? "unknown_contact"
          : json["contactType"] == "live"
              ? "live_contact"
              : json["contactType"] == "local"
                  ? "local_contact"
                  : json["contactType"] == "deleted"
                      ? "deleted_contact"
                      : json["contactType"],
      email: json["email"],
      groupCreatedTime: json["groupCreatedTime"],
      image: json["image"],
      imagePrivacyFlag: json["imagePrivacyFlag"],
      isAdminBlocked: Platform.isAndroid
          ? json["isAdminBlocked"]
          : json["isBlockedByAdmin"],
      isBlocked: json["isBlocked"],
      isBlockedMe: json["isBlockedMe"],
      isGroupAdmin: json["isGroupAdmin"],
      isGroupInOfflineMode: json["isGroupInOfflineMode"],
      isGroupProfile: Platform.isAndroid
          ? json["isGroupProfile"]
          : json["profileChatType"].toString().toLowerCase() == "singlechat"
              ? false
              : true,
      isItSavedContact: json["isItSavedContact"],
      isMuted: json["isMuted"],
      isSelected: json["isSelected"],
      jid: json["jid"],
      lastSeenPrivacyFlag: json["lastSeenPrivacyFlag"],
      mobileNUmberPrivacyFlag: json["mobileNUmberPrivacyFlag"],
      mobileNumber: json["mobileNumber"],
      name: json["name"],
      nickName: json["nickName"].toString(),
      status: json["status"],
    );