copyWith method

MessageCopyOptions copyWith({
  1. bool? sendCopy,
  2. bool? replaceCaption,
  3. FormattedText? newCaption()?,
  4. bool? newShowCaptionAboveMedia,
})

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

Implementation

MessageCopyOptions copyWith({
  bool? sendCopy,
  bool? replaceCaption,
  FormattedText? Function()? newCaption,
  bool? newShowCaptionAboveMedia,
}) => MessageCopyOptions(
  sendCopy: sendCopy ?? this.sendCopy,
  replaceCaption: replaceCaption ?? this.replaceCaption,
  newCaption: newCaption != null ? newCaption() : this.newCaption,
  newShowCaptionAboveMedia:
      newShowCaptionAboveMedia ?? this.newShowCaptionAboveMedia,
);