copyWith method

  1. @override
InputMessagePhoto copyWith({
  1. InputFile? photo,
  2. InputThumbnail? thumbnail()?,
  3. List<int>? addedStickerFileIds,
  4. int? width,
  5. int? height,
  6. FormattedText? caption()?,
  7. MessageSelfDestructType? selfDestructType()?,
  8. bool? hasSpoiler,
})
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
InputMessagePhoto copyWith({
  InputFile? photo,
  InputThumbnail? Function()? thumbnail,
  List<int>? addedStickerFileIds,
  int? width,
  int? height,
  FormattedText? Function()? caption,
  MessageSelfDestructType? Function()? selfDestructType,
  bool? hasSpoiler,
}) =>
    InputMessagePhoto(
      photo: photo ?? this.photo,
      thumbnail: thumbnail != null ? thumbnail() : this.thumbnail,
      addedStickerFileIds: addedStickerFileIds ?? this.addedStickerFileIds,
      width: width ?? this.width,
      height: height ?? this.height,
      caption: caption != null ? caption() : this.caption,
      selfDestructType: selfDestructType != null
          ? selfDestructType()
          : this.selfDestructType,
      hasSpoiler: hasSpoiler ?? this.hasSpoiler,
    );