create static method

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

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

Implementation

static Animation create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "animation",
  String special_return_type = "animation",
  num? duration,
  num? width,
  num? height,
  String? file_name,
  String? mime_type,
  bool? has_stickers,
  Minithumbnail? minithumbnail,
  Thumbnail? thumbnail,
  File? animation,
}) {
  // Animation animation = Animation({
  final Map animation_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,
    "minithumbnail": (minithumbnail != null) ? minithumbnail.toJson() : null,
    "thumbnail": (thumbnail != null) ? thumbnail.toJson() : null,
    "animation": (animation != null) ? animation.toJson() : null,
  };

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

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