UserPrivacySetting.fromJson constructor

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

a UserPrivacySetting return type can be :

  • UserPrivacySettingShowStatus
  • UserPrivacySettingShowProfilePhoto
  • UserPrivacySettingShowLinkInForwardedMessages
  • UserPrivacySettingShowPhoneNumber
  • UserPrivacySettingAllowChatInvites
  • UserPrivacySettingAllowCalls
  • UserPrivacySettingAllowPeerToPeerCalls
  • UserPrivacySettingAllowFindingByPhoneNumber

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 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);
    default:
      return null;
  }
}