copyWith method

InputPhoto copyWith({
  1. InputFile? photo,
  2. InputThumbnail? thumbnail()?,
  3. InputFile? video()?,
  4. List<int>? addedStickerFileIds,
  5. int? width,
  6. int? height,
})

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

Implementation

InputPhoto copyWith({
  InputFile? photo,
  InputThumbnail? Function()? thumbnail,
  InputFile? Function()? video,
  List<int>? addedStickerFileIds,
  int? width,
  int? height,
}) => InputPhoto(
  photo: photo ?? this.photo,
  thumbnail: thumbnail != null ? thumbnail() : this.thumbnail,
  video: video != null ? video() : this.video,
  addedStickerFileIds: addedStickerFileIds ?? this.addedStickerFileIds,
  width: width ?? this.width,
  height: height ?? this.height,
);