copyWith method

Chat copyWith({
  1. int? id,
  2. ChatType? type,
  3. String? title,
  4. ChatPhotoInfo? photo()?,
  5. int? accentColorId,
  6. int? backgroundCustomEmojiId,
  7. UpgradedGiftColors? upgradedGiftColors()?,
  8. int? profileAccentColorId,
  9. int? profileBackgroundCustomEmojiId,
  10. ChatPermissions? permissions,
  11. Message? lastMessage()?,
  12. List<ChatPosition>? positions,
  13. List<ChatList>? chatLists,
  14. MessageSender? messageSenderId()?,
  15. BlockList? blockList()?,
  16. bool? hasProtectedContent,
  17. bool? isTranslatable,
  18. bool? isMarkedAsUnread,
  19. bool? viewAsTopics,
  20. bool? hasScheduledMessages,
  21. bool? hasWelcomeMessages,
  22. bool? canBeDeletedOnlyForSelf,
  23. bool? canBeDeletedForAllUsers,
  24. bool? canBeReported,
  25. bool? defaultDisableNotification,
  26. int? unreadCount,
  27. int? lastReadInboxMessageId,
  28. int? lastReadOutboxMessageId,
  29. int? unreadMentionCount,
  30. int? unreadReactionCount,
  31. int? unreadPollVoteCount,
  32. ChatNotificationSettings? notificationSettings,
  33. ChatAvailableReactions? availableReactions,
  34. int? messageAutoDeleteTime,
  35. EmojiStatus? emojiStatus()?,
  36. ChatBackground? background()?,
  37. ChatTheme? theme()?,
  38. ChatActionBar? actionBar()?,
  39. BusinessBotManageBar? businessBotManageBar()?,
  40. VideoChat? videoChat,
  41. ChatJoinRequestsInfo? pendingJoinRequests()?,
  42. int? replyMarkupMessageId,
  43. DraftMessage? draftMessage()?,
  44. String? clientData,
  45. dynamic extra,
  46. 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

Chat copyWith({
  int? id,
  ChatType? type,
  String? title,
  ChatPhotoInfo? Function()? photo,
  int? accentColorId,
  int? backgroundCustomEmojiId,
  UpgradedGiftColors? Function()? upgradedGiftColors,
  int? profileAccentColorId,
  int? profileBackgroundCustomEmojiId,
  ChatPermissions? permissions,
  Message? Function()? lastMessage,
  List<ChatPosition>? positions,
  List<ChatList>? chatLists,
  MessageSender? Function()? messageSenderId,
  BlockList? Function()? blockList,
  bool? hasProtectedContent,
  bool? isTranslatable,
  bool? isMarkedAsUnread,
  bool? viewAsTopics,
  bool? hasScheduledMessages,
  bool? hasWelcomeMessages,
  bool? canBeDeletedOnlyForSelf,
  bool? canBeDeletedForAllUsers,
  bool? canBeReported,
  bool? defaultDisableNotification,
  int? unreadCount,
  int? lastReadInboxMessageId,
  int? lastReadOutboxMessageId,
  int? unreadMentionCount,
  int? unreadReactionCount,
  int? unreadPollVoteCount,
  ChatNotificationSettings? notificationSettings,
  ChatAvailableReactions? availableReactions,
  int? messageAutoDeleteTime,
  EmojiStatus? Function()? emojiStatus,
  ChatBackground? Function()? background,
  ChatTheme? Function()? theme,
  ChatActionBar? Function()? actionBar,
  BusinessBotManageBar? Function()? businessBotManageBar,
  VideoChat? videoChat,
  ChatJoinRequestsInfo? Function()? pendingJoinRequests,
  int? replyMarkupMessageId,
  DraftMessage? Function()? draftMessage,
  String? clientData,
  dynamic extra,
  int? clientId,
}) => Chat(
  id: id ?? this.id,
  type: type ?? this.type,
  title: title ?? this.title,
  photo: photo != null ? photo() : this.photo,
  accentColorId: accentColorId ?? this.accentColorId,
  backgroundCustomEmojiId:
      backgroundCustomEmojiId ?? this.backgroundCustomEmojiId,
  upgradedGiftColors: upgradedGiftColors != null
      ? upgradedGiftColors()
      : this.upgradedGiftColors,
  profileAccentColorId: profileAccentColorId ?? this.profileAccentColorId,
  profileBackgroundCustomEmojiId:
      profileBackgroundCustomEmojiId ?? this.profileBackgroundCustomEmojiId,
  permissions: permissions ?? this.permissions,
  lastMessage: lastMessage != null ? lastMessage() : this.lastMessage,
  positions: positions ?? this.positions,
  chatLists: chatLists ?? this.chatLists,
  messageSenderId: messageSenderId != null
      ? messageSenderId()
      : this.messageSenderId,
  blockList: blockList != null ? blockList() : this.blockList,
  hasProtectedContent: hasProtectedContent ?? this.hasProtectedContent,
  isTranslatable: isTranslatable ?? this.isTranslatable,
  isMarkedAsUnread: isMarkedAsUnread ?? this.isMarkedAsUnread,
  viewAsTopics: viewAsTopics ?? this.viewAsTopics,
  hasScheduledMessages: hasScheduledMessages ?? this.hasScheduledMessages,
  hasWelcomeMessages: hasWelcomeMessages ?? this.hasWelcomeMessages,
  canBeDeletedOnlyForSelf:
      canBeDeletedOnlyForSelf ?? this.canBeDeletedOnlyForSelf,
  canBeDeletedForAllUsers:
      canBeDeletedForAllUsers ?? this.canBeDeletedForAllUsers,
  canBeReported: canBeReported ?? this.canBeReported,
  defaultDisableNotification:
      defaultDisableNotification ?? this.defaultDisableNotification,
  unreadCount: unreadCount ?? this.unreadCount,
  lastReadInboxMessageId:
      lastReadInboxMessageId ?? this.lastReadInboxMessageId,
  lastReadOutboxMessageId:
      lastReadOutboxMessageId ?? this.lastReadOutboxMessageId,
  unreadMentionCount: unreadMentionCount ?? this.unreadMentionCount,
  unreadReactionCount: unreadReactionCount ?? this.unreadReactionCount,
  unreadPollVoteCount: unreadPollVoteCount ?? this.unreadPollVoteCount,
  notificationSettings: notificationSettings ?? this.notificationSettings,
  availableReactions: availableReactions ?? this.availableReactions,
  messageAutoDeleteTime: messageAutoDeleteTime ?? this.messageAutoDeleteTime,
  emojiStatus: emojiStatus != null ? emojiStatus() : this.emojiStatus,
  background: background != null ? background() : this.background,
  theme: theme != null ? theme() : this.theme,
  actionBar: actionBar != null ? actionBar() : this.actionBar,
  businessBotManageBar: businessBotManageBar != null
      ? businessBotManageBar()
      : this.businessBotManageBar,
  videoChat: videoChat ?? this.videoChat,
  pendingJoinRequests: pendingJoinRequests != null
      ? pendingJoinRequests()
      : this.pendingJoinRequests,
  replyMarkupMessageId: replyMarkupMessageId ?? this.replyMarkupMessageId,
  draftMessage: draftMessage != null ? draftMessage() : this.draftMessage,
  clientData: clientData ?? this.clientData,
  extra: extra ?? this.extra,
  clientId: clientId ?? this.clientId,
);