create static method

MessageVoiceNote create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "messageVoiceNote",
  3. String special_return_type = "messageContent",
  4. VoiceNote? voice_note,
  5. FormattedText? caption,
  6. bool? is_listened,
})
override

Generate By AZKADEV | Azka Axelion Gibran Script Dont edit by hand or anything manual

Implementation

static MessageVoiceNote create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "messageVoiceNote",
  String special_return_type = "messageContent",
  VoiceNote? voice_note,
  FormattedText? caption,
  bool? is_listened,
}) {
  // MessageVoiceNote messageVoiceNote = MessageVoiceNote({
  final Map messageVoiceNote_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "voice_note": (voice_note != null) ? voice_note.toJson() : null,
    "caption": (caption != null) ? caption.toJson() : null,
    "is_listened": is_listened,
  };

  messageVoiceNote_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (messageVoiceNote_data_create_json.containsKey(key) == false) {
        messageVoiceNote_data_create_json[key] = value;
      }
    });
  }
  return MessageVoiceNote(messageVoiceNote_data_create_json);
}