copyWith method
ChatMessage
copyWith({
- String? id,
- String? content,
- String? role,
- DateTime? timestamp,
- bool? isLoading,
- String? imageUrl,
- Uint8List? imageBytes,
- String? fileName,
- MessageType? type,
- bool? isThinking,
- String? thinkingStatus,
- bool? isStreaming,
- List<
QuickReplyButton> ? quickReplies, - Map<
String, dynamic> ? uiComponentData, - String? audioPath,
- int? audioDuration,
Implementation
ChatMessage copyWith({
String? id,
String? content,
String? role,
DateTime? timestamp,
bool? isLoading,
String? imageUrl,
Uint8List? imageBytes,
String? fileName,
MessageType? type,
bool? isThinking,
String? thinkingStatus,
bool? isStreaming,
List<QuickReplyButton>? quickReplies,
Map<String, dynamic>? uiComponentData,
String? audioPath,
int? audioDuration,
}) {
return ChatMessage(
id: id ?? this.id,
content: content ?? this.content,
role: role ?? this.role,
timestamp: timestamp ?? this.timestamp,
isLoading: isLoading ?? this.isLoading,
imageUrl: imageUrl ?? this.imageUrl,
imageBytes: imageBytes ?? this.imageBytes,
fileName: fileName ?? this.fileName,
type: type ?? this.type,
isThinking: isThinking ?? this.isThinking,
thinkingStatus: thinkingStatus ?? this.thinkingStatus,
isStreaming: isStreaming ?? this.isStreaming,
quickReplies: quickReplies ?? this.quickReplies,
uiComponentData: uiComponentData ?? this.uiComponentData,
audioPath: audioPath ?? this.audioPath,
audioDuration: audioDuration ?? this.audioDuration,
);
}