copyWith method

  1. @override
MessagePhoto copyWith({
  1. Photo? photo,
  2. FormattedText? caption,
  3. bool? showCaptionAboveMedia,
  4. bool? hasSpoiler,
  5. bool? isSecret,
})
override

Copy model with modified properties.

Properties:

  • photo: The photo
  • caption: Photo caption
  • show_caption_above_media: True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo
  • has_spoiler: True, if the photo preview must be covered by a spoiler animation
  • is_secret: True, if the photo must be blurred and must be shown only while tapped

Implementation

@override
MessagePhoto copyWith({
  Photo? photo,
  FormattedText? caption,
  bool? showCaptionAboveMedia,
  bool? hasSpoiler,
  bool? isSecret,
}) =>
    MessagePhoto(
      photo: photo ?? this.photo,
      caption: caption ?? this.caption,
      showCaptionAboveMedia:
          showCaptionAboveMedia ?? this.showCaptionAboveMedia,
      hasSpoiler: hasSpoiler ?? this.hasSpoiler,
      isSecret: isSecret ?? this.isSecret,
    );