copyWith method
SavedMessagesTopic
copyWith({
- int? id,
- SavedMessagesTopicType? type,
- bool? isPinned,
- int? order,
- Message? lastMessage()?,
- 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,
);