toJson method
Creates a json from the object
Implementation
Map toJson() {
return {
'type': type,
'id': id,
'voice_url': voiceUrl,
'title': title,
'caption': caption,
'parse_mode': parseMode,
'caption_entities': captionEntities,
'voice_duration': voiceDuration,
'reply_markup': replyMarkup,
'input_message_content': inputMessageContent,
}..removeWhere((_, v) => v == null);
}