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
SenderMessage copyWith({
bool? isLoading,
List<MessageElement>? elements,
bool? isFailed,
String? timestamp,
double? width,
}) {
return SenderMessage(
id: id,
timestamp: timestamp ?? this.timestamp,
elements: elements ?? this.elements,
isLoading: isLoading ?? this.isLoading,
isFailed: isFailed ?? this.isFailed,
name: name,
width: width ?? this.width,
);
}