create static method

MessagePhoto create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "messagePhoto",
  3. String special_return_type = "messageContent",
  4. Photo? photo,
  5. FormattedText? caption,
  6. bool? show_caption_above_media,
  7. bool? has_spoiler,
  8. bool? is_secret,
})
override

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

Implementation

static MessagePhoto create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "messagePhoto",
  String special_return_type = "messageContent",
  Photo? photo,
  FormattedText? caption,
  bool? show_caption_above_media,
  bool? has_spoiler,
  bool? is_secret,
}) {
  // MessagePhoto messagePhoto = MessagePhoto({
  final Map messagePhoto_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "photo": (photo != null) ? photo.toJson() : null,
    "caption": (caption != null) ? caption.toJson() : null,
    "show_caption_above_media": show_caption_above_media,
    "has_spoiler": has_spoiler,
    "is_secret": is_secret,
  };

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

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