copyWith method

ChatMessageSender copyWith({
  1. MessageSender? sender,
  2. bool? needsPremium,
})

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

Implementation

ChatMessageSender copyWith({
  MessageSender? sender,
  bool? needsPremium,
}) =>
    ChatMessageSender(
      sender: sender ?? this.sender,
      needsPremium: needsPremium ?? this.needsPremium,
    );