toJson method

Map toJson()

Creates a json from the object

Implementation

Map toJson() {
  return {
    'id': id,
    'type': type,
    'title': title,
    'username': username,
    'first_name': firstName,
    'last_name': lastName,
    'photo': photo,
    '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_protected_content': hasProtectedContent,
    'sticker_set_name': stickerSetName,
    'can_set_sticker_set': canSetStickerSet,
    'linked_chat_id': linkedChatId,
    'location': location,
  }..removeWhere((_, v) => v == null);
}