copyWith method

Story copyWith({
  1. int? id,
  2. int? senderChatId,
  3. MessageSender? senderId()?,
  4. int? date,
  5. bool? isBeingSent,
  6. bool? isBeingEdited,
  7. bool? isEdited,
  8. bool? isPinned,
  9. bool? isVisibleOnlyForSelf,
  10. bool? canBeDeleted,
  11. bool? canBeEdited,
  12. bool? canBeForwarded,
  13. bool? canBeReplied,
  14. bool? canToggleIsPinned,
  15. bool? canGetStatistics,
  16. bool? canGetInteractions,
  17. bool? hasExpiredViewers,
  18. StoryRepostInfo? repostInfo()?,
  19. StoryInteractionInfo? interactionInfo()?,
  20. ReactionType? chosenReactionType()?,
  21. StoryPrivacySettings? privacySettings,
  22. StoryContent? content,
  23. List<StoryArea>? areas,
  24. FormattedText? caption,
  25. dynamic extra,
  26. 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,
    );