copyWith method
Story
copyWith({
- int? id,
- int? senderChatId,
- MessageSender? senderId()?,
- int? date,
- bool? isBeingSent,
- bool? isBeingEdited,
- bool? isEdited,
- bool? isPinned,
- bool? isVisibleOnlyForSelf,
- bool? canBeDeleted,
- bool? canBeEdited,
- bool? canBeForwarded,
- bool? canBeReplied,
- bool? canToggleIsPinned,
- bool? canGetStatistics,
- bool? canGetInteractions,
- bool? hasExpiredViewers,
- StoryRepostInfo? repostInfo()?,
- StoryInteractionInfo? interactionInfo()?,
- ReactionType? chosenReactionType()?,
- StoryPrivacySettings? privacySettings,
- StoryContent? content,
- List<
StoryArea> ? areas, - FormattedText? caption,
- 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
Story copyWith({
int? id,
int? senderChatId,
MessageSender? Function()? senderId,
int? date,
bool? isBeingSent,
bool? isBeingEdited,
bool? isEdited,
bool? isPinned,
bool? isVisibleOnlyForSelf,
bool? canBeDeleted,
bool? canBeEdited,
bool? canBeForwarded,
bool? canBeReplied,
bool? canToggleIsPinned,
bool? canGetStatistics,
bool? canGetInteractions,
bool? hasExpiredViewers,
StoryRepostInfo? Function()? repostInfo,
StoryInteractionInfo? Function()? interactionInfo,
ReactionType? Function()? chosenReactionType,
StoryPrivacySettings? privacySettings,
StoryContent? content,
List<StoryArea>? areas,
FormattedText? caption,
dynamic extra,
int? clientId,
}) =>
Story(
id: id ?? this.id,
senderChatId: senderChatId ?? this.senderChatId,
senderId: senderId != null ? senderId() : this.senderId,
date: date ?? this.date,
isBeingSent: isBeingSent ?? this.isBeingSent,
isBeingEdited: isBeingEdited ?? this.isBeingEdited,
isEdited: isEdited ?? this.isEdited,
isPinned: isPinned ?? this.isPinned,
isVisibleOnlyForSelf: isVisibleOnlyForSelf ?? this.isVisibleOnlyForSelf,
canBeDeleted: canBeDeleted ?? this.canBeDeleted,
canBeEdited: canBeEdited ?? this.canBeEdited,
canBeForwarded: canBeForwarded ?? this.canBeForwarded,
canBeReplied: canBeReplied ?? this.canBeReplied,
canToggleIsPinned: canToggleIsPinned ?? this.canToggleIsPinned,
canGetStatistics: canGetStatistics ?? this.canGetStatistics,
canGetInteractions: canGetInteractions ?? this.canGetInteractions,
hasExpiredViewers: hasExpiredViewers ?? this.hasExpiredViewers,
repostInfo: repostInfo != null ? repostInfo() : this.repostInfo,
interactionInfo:
interactionInfo != null ? interactionInfo() : this.interactionInfo,
chosenReactionType: chosenReactionType != null
? chosenReactionType()
: this.chosenReactionType,
privacySettings: privacySettings ?? this.privacySettings,
content: content ?? this.content,
areas: areas ?? this.areas,
caption: caption ?? this.caption,
extra: extra ?? this.extra,
clientId: clientId ?? this.clientId,
);