copyWith method

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

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

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