copyWith method

Message copyWith({
  1. int? id,
  2. MessageSender? senderId,
  3. MessageSender? receiverId()?,
  4. int? chatId,
  5. MessageSendingState? sendingState()?,
  6. MessageSchedulingState? schedulingState()?,
  7. bool? isOutgoing,
  8. bool? isPinned,
  9. bool? isFromOffline,
  10. bool? canBeSaved,
  11. bool? hasTimestampedMedia,
  12. bool? isChannelPost,
  13. bool? isPaidStarSuggestedPost,
  14. bool? isPaidGramSuggestedPost,
  15. bool? containsUnreadMention,
  16. bool? containsUnreadPollVotes,
  17. int? date,
  18. int? editDate,
  19. MessageForwardInfo? forwardInfo()?,
  20. MessageImportInfo? importInfo()?,
  21. MessageInteractionInfo? interactionInfo()?,
  22. List<UnreadReaction>? unreadReactions,
  23. FactCheck? factCheck()?,
  24. SuggestedPostInfo? suggestedPostInfo()?,
  25. MessageReplyTo? replyTo()?,
  26. MessageTopic? topicId()?,
  27. MessageSelfDestructType? selfDestructType()?,
  28. double? selfDestructIn,
  29. double? autoDeleteIn,
  30. int? viaBotUserId,
  31. MessageSender? guestBotCallerId()?,
  32. int? senderBusinessBotUserId,
  33. int? senderBoostCount,
  34. String? senderTag,
  35. int? paidMessageStarCount,
  36. String? authorSignature,
  37. int? mediaAlbumId,
  38. int? effectId,
  39. RestrictionInfo? restrictionInfo()?,
  40. String? summaryLanguageCode,
  41. MessageContent? content,
  42. EphemeralMessageContent? ephemeralContent()?,
  43. ReplyMarkup? replyMarkup()?,
  44. int? ephemeralMessageId,
  45. int? chatInstance,
  46. dynamic extra,
  47. int? clientId,
})

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

Implementation

Message copyWith({
  int? id,
  MessageSender? senderId,
  MessageSender? Function()? receiverId,
  int? chatId,
  MessageSendingState? Function()? sendingState,
  MessageSchedulingState? Function()? schedulingState,
  bool? isOutgoing,
  bool? isPinned,
  bool? isFromOffline,
  bool? canBeSaved,
  bool? hasTimestampedMedia,
  bool? isChannelPost,
  bool? isPaidStarSuggestedPost,
  bool? isPaidGramSuggestedPost,
  bool? containsUnreadMention,
  bool? containsUnreadPollVotes,
  int? date,
  int? editDate,
  MessageForwardInfo? Function()? forwardInfo,
  MessageImportInfo? Function()? importInfo,
  MessageInteractionInfo? Function()? interactionInfo,
  List<UnreadReaction>? unreadReactions,
  FactCheck? Function()? factCheck,
  SuggestedPostInfo? Function()? suggestedPostInfo,
  MessageReplyTo? Function()? replyTo,
  MessageTopic? Function()? topicId,
  MessageSelfDestructType? Function()? selfDestructType,
  double? selfDestructIn,
  double? autoDeleteIn,
  int? viaBotUserId,
  MessageSender? Function()? guestBotCallerId,
  int? senderBusinessBotUserId,
  int? senderBoostCount,
  String? senderTag,
  int? paidMessageStarCount,
  String? authorSignature,
  int? mediaAlbumId,
  int? effectId,
  RestrictionInfo? Function()? restrictionInfo,
  String? summaryLanguageCode,
  MessageContent? content,
  EphemeralMessageContent? Function()? ephemeralContent,
  ReplyMarkup? Function()? replyMarkup,
  int? ephemeralMessageId,
  int? chatInstance,
  dynamic extra,
  int? clientId,
}) => Message(
  id: id ?? this.id,
  senderId: senderId ?? this.senderId,
  receiverId: receiverId != null ? receiverId() : this.receiverId,
  chatId: chatId ?? this.chatId,
  sendingState: sendingState != null ? sendingState() : this.sendingState,
  schedulingState: schedulingState != null
      ? schedulingState()
      : this.schedulingState,
  isOutgoing: isOutgoing ?? this.isOutgoing,
  isPinned: isPinned ?? this.isPinned,
  isFromOffline: isFromOffline ?? this.isFromOffline,
  canBeSaved: canBeSaved ?? this.canBeSaved,
  hasTimestampedMedia: hasTimestampedMedia ?? this.hasTimestampedMedia,
  isChannelPost: isChannelPost ?? this.isChannelPost,
  isPaidStarSuggestedPost:
      isPaidStarSuggestedPost ?? this.isPaidStarSuggestedPost,
  isPaidGramSuggestedPost:
      isPaidGramSuggestedPost ?? this.isPaidGramSuggestedPost,
  containsUnreadMention: containsUnreadMention ?? this.containsUnreadMention,
  containsUnreadPollVotes:
      containsUnreadPollVotes ?? this.containsUnreadPollVotes,
  date: date ?? this.date,
  editDate: editDate ?? this.editDate,
  forwardInfo: forwardInfo != null ? forwardInfo() : this.forwardInfo,
  importInfo: importInfo != null ? importInfo() : this.importInfo,
  interactionInfo: interactionInfo != null
      ? interactionInfo()
      : this.interactionInfo,
  unreadReactions: unreadReactions ?? this.unreadReactions,
  factCheck: factCheck != null ? factCheck() : this.factCheck,
  suggestedPostInfo: suggestedPostInfo != null
      ? suggestedPostInfo()
      : this.suggestedPostInfo,
  replyTo: replyTo != null ? replyTo() : this.replyTo,
  topicId: topicId != null ? topicId() : this.topicId,
  selfDestructType: selfDestructType != null
      ? selfDestructType()
      : this.selfDestructType,
  selfDestructIn: selfDestructIn ?? this.selfDestructIn,
  autoDeleteIn: autoDeleteIn ?? this.autoDeleteIn,
  viaBotUserId: viaBotUserId ?? this.viaBotUserId,
  guestBotCallerId: guestBotCallerId != null
      ? guestBotCallerId()
      : this.guestBotCallerId,
  senderBusinessBotUserId:
      senderBusinessBotUserId ?? this.senderBusinessBotUserId,
  senderBoostCount: senderBoostCount ?? this.senderBoostCount,
  senderTag: senderTag ?? this.senderTag,
  paidMessageStarCount: paidMessageStarCount ?? this.paidMessageStarCount,
  authorSignature: authorSignature ?? this.authorSignature,
  mediaAlbumId: mediaAlbumId ?? this.mediaAlbumId,
  effectId: effectId ?? this.effectId,
  restrictionInfo: restrictionInfo != null
      ? restrictionInfo()
      : this.restrictionInfo,
  summaryLanguageCode: summaryLanguageCode ?? this.summaryLanguageCode,
  content: content ?? this.content,
  ephemeralContent: ephemeralContent != null
      ? ephemeralContent()
      : this.ephemeralContent,
  replyMarkup: replyMarkup != null ? replyMarkup() : this.replyMarkup,
  ephemeralMessageId: ephemeralMessageId ?? this.ephemeralMessageId,
  chatInstance: chatInstance ?? this.chatInstance,
  extra: extra ?? this.extra,
  clientId: clientId ?? this.clientId,
);