create static method

Thumbnail create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "thumbnail",
  3. String special_return_type = "thumbnail",
  4. ThumbnailFormat? format,
  5. num? width,
  6. num? height,
  7. File? file,
})
override

Generate By General Universe Script Dont edit by hand or anything manual

Implementation

static Thumbnail create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "thumbnail",
  String special_return_type = "thumbnail",
  ThumbnailFormat? format,
  num? width,
  num? height,
  File? file,
}) {
  // Thumbnail thumbnail = Thumbnail({
  final Map thumbnail_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "format": (format != null) ? format.toJson() : null,
    "width": width,
    "height": height,
    "file": (file != null) ? file.toJson() : null,
  };

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

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