toJson method
Creates a json from the object
Implementation
Map toJson() {
return {
'id': id,
'type': type,
'title': title,
'username': username,
'first_name': firstName,
'last_name': lastName,
'is_forum': isForum,
'photo': photo,
'active_usernames': activeUsernames,
'emoji_status_custom_emoji_id': emojiStatusCustomEmojiId,
'emoji_status_expiration_date': emojiStatusExpirationDate,
'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,
'permissions': permissions,
'slow_mode_delay': slowModeDelay,
'message_auto_delete_time': messageAutoDeleteTime,
'has_aggressive_anti_spam_enabled': hasAggressiveAntiSpamEnabled,
'has_hidden_members': hasHiddenMembers,
'has_protected_content': hasProtectedContent,
'sticker_set_name': stickerSetName,
'can_set_sticker_set': canSetStickerSet,
'linked_chat_id': linkedChatId,
'location': location,
}..removeWhere((_, v) => v == null);
}