copyWith method

WelcomeMessage copyWith({
  1. int? id,
  2. MessageContent? content,
})

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

Implementation

WelcomeMessage copyWith({int? id, MessageContent? content}) =>
    WelcomeMessage(id: id ?? this.id, content: content ?? this.content);