fromJson static method

InputMessagePhoto? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

static InputMessagePhoto? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return InputMessagePhoto(
    photo: InputPhoto.fromJson(tdMapFromJson(json['photo'])),
    caption: FormattedText.fromJson(tdMapFromJson(json['caption'])),
    showCaptionAboveMedia:
        (json['show_caption_above_media'] as bool?) ?? false,
    selfDestructType: MessageSelfDestructType.fromJson(
      tdMapFromJson(json['self_destruct_type']),
    ),
    hasSpoiler: (json['has_spoiler'] as bool?) ?? false,
  );
}