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(json['personal_photo'] as Map<String, dynamic>?),
    photo: ChatPhoto.fromJson(json['photo'] as Map<String, dynamic>?),
    publicPhoto:
        ChatPhoto.fromJson(json['public_photo'] as Map<String, dynamic>?),
    communityId: json['community_id'] as int?,
    blockList:
        BlockList.fromJson(json['block_list'] as Map<String, dynamic>?),
    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(json['bio'] as Map<String, dynamic>?),
    birthdate: Birthdate.fromJson(json['birthdate'] as Map<String, dynamic>?),
    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(
        json['gift_settings'] as Map<String, dynamic>?)!,
    botVerification: BotVerification.fromJson(
        json['bot_verification'] as Map<String, dynamic>?),
    mainProfileTab: ProfileTab.fromJson(
        json['main_profile_tab'] as Map<String, dynamic>?),
    firstProfileAudio:
        Audio.fromJson(json['first_profile_audio'] as Map<String, dynamic>?),
    rating: UserRating.fromJson(json['rating'] as Map<String, dynamic>?),
    pendingRating:
        UserRating.fromJson(json['pending_rating'] as Map<String, dynamic>?),
    pendingRatingDate: (json['pending_rating_date'] as int?) ?? 0,
    note: FormattedText.fromJson(json['note'] as Map<String, dynamic>?),
    tonWalletCard: TonWalletCard.fromJson(
        json['ton_wallet_card'] as Map<String, dynamic>?),
    shareTheme: ProfileShareTheme.fromJson(
        json['share_theme'] as Map<String, dynamic>?),
    businessInfo:
        BusinessInfo.fromJson(json['business_info'] as Map<String, dynamic>?),
    botInfo: BotInfo.fromJson(json['bot_info'] as Map<String, dynamic>?),
  );
}