copyWith method
Message
copyWith({
- int? id,
- MessageSender? senderId,
- MessageSender? receiverId()?,
- int? chatId,
- MessageSendingState? sendingState()?,
- MessageSchedulingState? 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? forwardInfo()?,
- MessageImportInfo? importInfo()?,
- MessageInteractionInfo? interactionInfo()?,
- List<
UnreadReaction> ? unreadReactions, - FactCheck? factCheck()?,
- SuggestedPostInfo? suggestedPostInfo()?,
- MessageReplyTo? replyTo()?,
- MessageTopic? topicId()?,
- MessageSelfDestructType? selfDestructType()?,
- double? selfDestructIn,
- double? autoDeleteIn,
- int? viaBotUserId,
- MessageSender? guestBotCallerId()?,
- int? senderBusinessBotUserId,
- int? senderBoostCount,
- String? senderTag,
- int? paidMessageStarCount,
- String? authorSignature,
- int? mediaAlbumId,
- int? effectId,
- RestrictionInfo? restrictionInfo()?,
- String? summaryLanguageCode,
- MessageContent? content,
- EphemeralMessageContent? ephemeralContent()?,
- ReplyMarkup? replyMarkup()?,
- int? ephemeralMessageId,
- int? chatInstance,
- dynamic extra,
- 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,
);