create static method

Video create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "video",
  3. String special_return_type = "video",
  4. num? duration,
  5. num? width,
  6. num? height,
  7. String? file_name,
  8. String? mime_type,
  9. bool? has_stickers,
  10. bool? supports_streaming,
  11. Minithumbnail? minithumbnail,
  12. Thumbnail? thumbnail,
  13. File? video,
})
override

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

Implementation

static Video create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "video",
  String special_return_type = "video",
  num? duration,
  num? width,
  num? height,
  String? file_name,
  String? mime_type,
  bool? has_stickers,
  bool? supports_streaming,
  Minithumbnail? minithumbnail,
  Thumbnail? thumbnail,
  File? video,
}) {
  // Video video = Video({
  final Map video_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "duration": duration,
    "width": width,
    "height": height,
    "file_name": file_name,
    "mime_type": mime_type,
    "has_stickers": has_stickers,
    "supports_streaming": supports_streaming,
    "minithumbnail": (minithumbnail != null) ? minithumbnail.toJson() : null,
    "thumbnail": (thumbnail != null) ? thumbnail.toJson() : null,
    "video": (video != null) ? video.toJson() : null,
  };

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

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