copyWith method

ChatEvent copyWith({
  1. int? id,
  2. int? date,
  3. MessageSender? memberId,
  4. ChatEventAction? action,
})

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

Implementation

ChatEvent copyWith({
  int? id,
  int? date,
  MessageSender? memberId,
  ChatEventAction? action,
}) => ChatEvent(
  id: id ?? this.id,
  date: date ?? this.date,
  memberId: memberId ?? this.memberId,
  action: action ?? this.action,
);