copyWith method

PinnedEvent copyWith({
  1. String? id,
  2. String? messageId,
  3. String? roomId,
  4. String? pinnedBy,
  5. DateTime? pinnedAt,
  6. DateTime? unpinnedAt,
})

Creates a copy with updated fields.

Implementation

PinnedEvent copyWith({
  String? id,
  String? messageId,
  String? roomId,
  String? pinnedBy,
  DateTime? pinnedAt,
  DateTime? unpinnedAt,
}) {
  return PinnedEvent(
    id: id ?? this.id,
    messageId: messageId ?? this.messageId,
    roomId: roomId ?? this.roomId,
    pinnedBy: pinnedBy ?? this.pinnedBy,
    pinnedAt: pinnedAt ?? this.pinnedAt,
    unpinnedAt: unpinnedAt ?? this.unpinnedAt,
  );
}