copyWith method
Creates a copy of this message with updated properties.
This method supports the Immutable Object pattern by allowing state updates without modifying the original instance.
Implementation
@override
ReceiverMessage copyWith({
bool? isLoading,
List<MessageElement>? elements,
bool? isFailed,
String? timestamp,
double? width,
}) {
final copy = ReceiverMessage(
name: name,
timestamp: timestamp ?? this.timestamp,
elements: elements ?? this.elements,
isLoading: isLoading ?? this.isLoading,
id: id,
width: width ?? this.width,
);
return copy;
}