toJson method

  1. @override
Map<String, dynamic> toJson()
override

Converts a ChatFullInfo object to json.

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    'id': id,
    'type': type.toJson(),
    'title': title,
    'username': username,
    'first_name': firstName,
    'last_name': lastName,
    'is_forum': isForum,
    'photo': photo?.toJson(),
    'active_usernames': activeUsernames,
    'bio': bio,
    'has_private_forwards': hasPrivateForwards,
    'has_restricted_voice_and_video_messages':
        hasRestrictedVoiceAndVideoMessages,
    'join_to_send_messages': joinToSendMessages,
    'join_by_request': joinByRequest,
    'description': description,
    'invite_link': inviteLink,
    'pinned_message': pinnedMessage?.toJson(),
    'permissions': permissions?.toJson(),
    'slow_mode_delay': slowModeDelay,
    'message_auto_delete_time': messageAutoDeleteTime,
    'has_protected_content': hasProtectedContent,
    'sticker_set_name': stickerSetName,
    'can_set_sticker_set': canSetStickerSet,
    'linked_chat_id': linkedChatId,
    'location': location?.toJson(),
    'has_hidden_members': hasHiddenMembers,
    'has_aggressive_anti_spam_enabled': hasAggressiveAntiSpamEnabled,
    'emoji_status_expiration_date': emojiStatusExpirationDate,
    'available_reactions': availableReactions?.map((e) {
      return e.toJson();
    }).toList(),
    'emoji_status_custom_emoji_id': emojiStatusCustomEmojiId,
    'accent_color_id': accentColorId,
    'background_custom_emoji_id': backgroundCustomEmojiId,
    'profile_accent_color_id': profileAccentColorId,
    'profile_background_custom_emoji_id': profileBackgroundCustomEmojiId,
    'has_visible_history': hasVisibleHistory,
    'unrestrict_boost_count': unrestrictBoostCount,
    'custom_emoji_sticker_set_name': customEmojiStickerSetName,
    'business_intro': businessIntro?.toJson(),
    'business_location': businessLocation?.toJson(),
    'business_opening_hours': businessOpeningHours?.toJson(),
    'personal_chat': personalChat?.toJson(),
    'birthdate': birthdate?.toJson(),
    'can_send_paid_media': canSendPaidMedia,
  }..removeWhere(_nullFilter);
}