copyWith method

PostStory copyWith({
  1. int? chatId,
  2. InputStoryContent? content,
  3. InputStoryAreas? areas()?,
  4. FormattedText? caption()?,
  5. StoryPrivacySettings? privacySettings,
  6. List<int>? albumIds,
  7. int? activePeriod,
  8. StoryFullId? fromStoryFullId()?,
  9. bool? isPostedToChatPage,
  10. bool? protectContent,
})

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

Implementation

PostStory copyWith({
  int? chatId,
  InputStoryContent? content,
  InputStoryAreas? Function()? areas,
  FormattedText? Function()? caption,
  StoryPrivacySettings? privacySettings,
  List<int>? albumIds,
  int? activePeriod,
  StoryFullId? Function()? fromStoryFullId,
  bool? isPostedToChatPage,
  bool? protectContent,
}) => PostStory(
  chatId: chatId ?? this.chatId,
  content: content ?? this.content,
  areas: areas != null ? areas() : this.areas,
  caption: caption != null ? caption() : this.caption,
  privacySettings: privacySettings ?? this.privacySettings,
  albumIds: albumIds ?? this.albumIds,
  activePeriod: activePeriod ?? this.activePeriod,
  fromStoryFullId: fromStoryFullId != null
      ? fromStoryFullId()
      : this.fromStoryFullId,
  isPostedToChatPage: isPostedToChatPage ?? this.isPostedToChatPage,
  protectContent: protectContent ?? this.protectContent,
);