create static method

Audio create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "audio",
  3. String special_return_type = "audio",
  4. num? duration,
  5. String? title,
  6. String? performer,
  7. String? file_name,
  8. String? mime_type,
  9. Minithumbnail? album_cover_minithumbnail,
  10. Thumbnail? album_cover_thumbnail,
  11. List<Thumbnail>? external_album_covers,
  12. File? audio,
})
override

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

Implementation

static Audio create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "audio",
  String special_return_type = "audio",
  num? duration,
  String? title,
  String? performer,
  String? file_name,
  String? mime_type,
  Minithumbnail? album_cover_minithumbnail,
  Thumbnail? album_cover_thumbnail,
  List<Thumbnail>? external_album_covers,
  File? audio,
}) {
  // Audio audio = Audio({
  final Map audio_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "duration": duration,
    "title": title,
    "performer": performer,
    "file_name": file_name,
    "mime_type": mime_type,
    "album_cover_minithumbnail": (album_cover_minithumbnail != null) ? album_cover_minithumbnail.toJson() : null,
    "album_cover_thumbnail": (album_cover_thumbnail != null) ? album_cover_thumbnail.toJson() : null,
    "external_album_covers": (external_album_covers != null) ? external_album_covers.toJson() : null,
    "audio": (audio != null) ? audio.toJson() : null,
  };

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

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