copyWith method

SavedMessagesTopic copyWith({
  1. int? id,
  2. SavedMessagesTopicType? type,
  3. bool? isPinned,
  4. int? order,
  5. Message? lastMessage()?,
  6. DraftMessage? draftMessage()?,
})

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

Implementation

SavedMessagesTopic copyWith({
  int? id,
  SavedMessagesTopicType? type,
  bool? isPinned,
  int? order,
  Message? Function()? lastMessage,
  DraftMessage? Function()? draftMessage,
}) =>
    SavedMessagesTopic(
      id: id ?? this.id,
      type: type ?? this.type,
      isPinned: isPinned ?? this.isPinned,
      order: order ?? this.order,
      lastMessage: lastMessage != null ? lastMessage() : this.lastMessage,
      draftMessage: draftMessage != null ? draftMessage() : this.draftMessage,
    );