UserPrivacySetting.fromJson constructor
a UserPrivacySetting return type can be :
- UserPrivacySettingShowStatus
- UserPrivacySettingShowProfilePhoto
- UserPrivacySettingShowLinkInForwardedMessages
- UserPrivacySettingShowPhoneNumber
- UserPrivacySettingShowBio
- UserPrivacySettingAllowChatInvites
- UserPrivacySettingAllowCalls
- UserPrivacySettingAllowPeerToPeerCalls
- UserPrivacySettingAllowFindingByPhoneNumber
- UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages
Implementation
factory UserPrivacySetting.fromJson(Map<String, dynamic> json) {
switch (json["@type"]) {
case UserPrivacySettingShowStatus.CONSTRUCTOR:
return UserPrivacySettingShowStatus.fromJson(json);
case UserPrivacySettingShowProfilePhoto.CONSTRUCTOR:
return UserPrivacySettingShowProfilePhoto.fromJson(json);
case UserPrivacySettingShowLinkInForwardedMessages.CONSTRUCTOR:
return UserPrivacySettingShowLinkInForwardedMessages.fromJson(json);
case UserPrivacySettingShowPhoneNumber.CONSTRUCTOR:
return UserPrivacySettingShowPhoneNumber.fromJson(json);
case UserPrivacySettingShowBio.CONSTRUCTOR:
return UserPrivacySettingShowBio.fromJson(json);
case UserPrivacySettingAllowChatInvites.CONSTRUCTOR:
return UserPrivacySettingAllowChatInvites.fromJson(json);
case UserPrivacySettingAllowCalls.CONSTRUCTOR:
return UserPrivacySettingAllowCalls.fromJson(json);
case UserPrivacySettingAllowPeerToPeerCalls.CONSTRUCTOR:
return UserPrivacySettingAllowPeerToPeerCalls.fromJson(json);
case UserPrivacySettingAllowFindingByPhoneNumber.CONSTRUCTOR:
return UserPrivacySettingAllowFindingByPhoneNumber.fromJson(json);
case UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages.CONSTRUCTOR:
return UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages.fromJson(
json);
default:
return const UserPrivacySetting();
}
}