MemberProfileDetails.fromJson constructor
Creates a MemberProfileDetails object from a JSON map.
The json
parameter should be a map containing the JSON data.
Returns a MemberProfileDetails object.
Implementation
factory MemberProfileDetails.fromJson(Map<String, dynamic> json) =>
MemberProfileDetails(
contactType: getContactType(json["contactType"].toString()),
email: json["email"],
groupCreatedTime: json["groupCreatedTime"].toString(),
image: json["image"],
imagePrivacyFlag: json["imagePrivacyFlag"].toString(),
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"].toString(),
mobileNUmberPrivacyFlag: json["mobileNUmberPrivacyFlag"].toString(),
mobileNumber: json["mobileNumber"],
name: json["name"],
nickName: json["nickName"],
status: json["status"],
thumbImage: json["thumbImage"],
);