copyWith method
Story
copyWith({
- int? id,
- int? posterChatId,
- MessageSender? posterId()?,
- int? date,
- bool? isBeingPosted,
- bool? isBeingEdited,
- bool? isEdited,
- bool? isPostedToChatPage,
- bool? isVisibleOnlyForSelf,
- bool? canBeAddedToAlbum,
- bool? canBeDeleted,
- bool? canBeEdited,
- bool? canBeForwarded,
- bool? canBeReplied,
- bool? canSetPrivacySettings,
- bool? canToggleIsPostedToChatPage,
- bool? canGetStatistics,
- bool? canGetInteractions,
- bool? hasExpiredViewers,
- StoryRepostInfo? repostInfo()?,
- StoryInteractionInfo? interactionInfo()?,
- ReactionType? chosenReactionType()?,
- StoryPrivacySettings? privacySettings,
- StoryContent? content,
- List<
StoryArea> ? areas, - FormattedText? caption,
- Audio? music()?,
- List<
int> ? albumIds, - 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? posterChatId,
MessageSender? Function()? posterId,
int? date,
bool? isBeingPosted,
bool? isBeingEdited,
bool? isEdited,
bool? isPostedToChatPage,
bool? isVisibleOnlyForSelf,
bool? canBeAddedToAlbum,
bool? canBeDeleted,
bool? canBeEdited,
bool? canBeForwarded,
bool? canBeReplied,
bool? canSetPrivacySettings,
bool? canToggleIsPostedToChatPage,
bool? canGetStatistics,
bool? canGetInteractions,
bool? hasExpiredViewers,
StoryRepostInfo? Function()? repostInfo,
StoryInteractionInfo? Function()? interactionInfo,
ReactionType? Function()? chosenReactionType,
StoryPrivacySettings? privacySettings,
StoryContent? content,
List<StoryArea>? areas,
FormattedText? caption,
Audio? Function()? music,
List<int>? albumIds,
dynamic extra,
int? clientId,
}) => Story(
id: id ?? this.id,
posterChatId: posterChatId ?? this.posterChatId,
posterId: posterId != null ? posterId() : this.posterId,
date: date ?? this.date,
isBeingPosted: isBeingPosted ?? this.isBeingPosted,
isBeingEdited: isBeingEdited ?? this.isBeingEdited,
isEdited: isEdited ?? this.isEdited,
isPostedToChatPage: isPostedToChatPage ?? this.isPostedToChatPage,
isVisibleOnlyForSelf: isVisibleOnlyForSelf ?? this.isVisibleOnlyForSelf,
canBeAddedToAlbum: canBeAddedToAlbum ?? this.canBeAddedToAlbum,
canBeDeleted: canBeDeleted ?? this.canBeDeleted,
canBeEdited: canBeEdited ?? this.canBeEdited,
canBeForwarded: canBeForwarded ?? this.canBeForwarded,
canBeReplied: canBeReplied ?? this.canBeReplied,
canSetPrivacySettings: canSetPrivacySettings ?? this.canSetPrivacySettings,
canToggleIsPostedToChatPage:
canToggleIsPostedToChatPage ?? this.canToggleIsPostedToChatPage,
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,
music: music != null ? music() : this.music,
albumIds: albumIds ?? this.albumIds,
extra: extra ?? this.extra,
clientId: clientId ?? this.clientId,
);