fromJson static method

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

Implementation

static UserFullInfo? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return UserFullInfo(
    personalPhoto: ChatPhoto.fromJson(tdMapFromJson(json['personal_photo'])),
    photo: ChatPhoto.fromJson(tdMapFromJson(json['photo'])),
    publicPhoto: ChatPhoto.fromJson(tdMapFromJson(json['public_photo'])),
    communityId: (json['community_id'] as int?),
    blockList: BlockList.fromJson(tdMapFromJson(json['block_list'])),
    canBeCalled: (json['can_be_called'] as bool?) ?? false,
    supportsVideoCalls: (json['supports_video_calls'] as bool?) ?? false,
    hasPrivateCalls: (json['has_private_calls'] as bool?) ?? false,
    hasPrivateForwards: (json['has_private_forwards'] as bool?) ?? false,
    hasRestrictedVoiceAndVideoNoteMessages:
        (json['has_restricted_voice_and_video_note_messages'] as bool?) ??
        false,
    hasPostedToProfileStories:
        (json['has_posted_to_profile_stories'] as bool?) ?? false,
    hasSponsoredMessagesEnabled:
        (json['has_sponsored_messages_enabled'] as bool?) ?? false,
    needPhoneNumberPrivacyException:
        (json['need_phone_number_privacy_exception'] as bool?) ?? false,
    setChatBackground: (json['set_chat_background'] as bool?) ?? false,
    usesUnofficialApp: (json['uses_unofficial_app'] as bool?) ?? false,
    bio: FormattedText.fromJson(tdMapFromJson(json['bio'])),
    birthdate: Birthdate.fromJson(tdMapFromJson(json['birthdate'])),
    personalChatId: (json['personal_chat_id'] as int?) ?? 0,
    giftCount: (json['gift_count'] as int?) ?? 0,
    groupInCommonCount: (json['group_in_common_count'] as int?) ?? 0,
    incomingPaidMessageStarCount:
        (json['incoming_paid_message_star_count'] as int?) ?? 0,
    outgoingPaidMessageStarCount:
        (json['outgoing_paid_message_star_count'] as int?) ?? 0,
    giftSettings: GiftSettings.fromJson(tdMapFromJson(json['gift_settings'])),
    botVerification: BotVerification.fromJson(
      tdMapFromJson(json['bot_verification']),
    ),
    mainProfileTab: ProfileTab.fromJson(
      tdMapFromJson(json['main_profile_tab']),
    ),
    firstProfileAudio: Audio.fromJson(
      tdMapFromJson(json['first_profile_audio']),
    ),
    rating: UserRating.fromJson(tdMapFromJson(json['rating'])),
    pendingRating: UserRating.fromJson(tdMapFromJson(json['pending_rating'])),
    pendingRatingDate: (json['pending_rating_date'] as int?) ?? 0,
    note: FormattedText.fromJson(tdMapFromJson(json['note'])),
    businessInfo: BusinessInfo.fromJson(tdMapFromJson(json['business_info'])),
    botInfo: BotInfo.fromJson(tdMapFromJson(json['bot_info'])),
  );
}