create static method

Sticker create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "sticker",
  3. String special_return_type = "sticker",
  4. num? id,
  5. num? set_id,
  6. num? width,
  7. num? height,
  8. String? emoji,
  9. StickerFormat? format,
  10. StickerFullType? full_type,
  11. Thumbnail? thumbnail,
  12. File? sticker,
})
override

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

Implementation

static Sticker create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "sticker",
  String special_return_type = "sticker",
  num? id,
  num? set_id,
  num? width,
  num? height,
  String? emoji,
  StickerFormat? format,
  StickerFullType? full_type,
  Thumbnail? thumbnail,
  File? sticker,
}) {
  // Sticker sticker = Sticker({
  final Map sticker_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "id": id,
    "set_id": set_id,
    "width": width,
    "height": height,
    "emoji": emoji,
    "format": (format != null) ? format.toJson() : null,
    "full_type": (full_type != null) ? full_type.toJson() : null,
    "thumbnail": (thumbnail != null) ? thumbnail.toJson() : null,
    "sticker": (sticker != null) ? sticker.toJson() : null,
  };

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

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