copyWith method

ChatState copyWith({
  1. List<ChatMessage>? messages,
  2. bool? isLoading,
  3. bool? isRestoring,
  4. bool? isReadOnly,
  5. String? error,
})

Implementation

ChatState copyWith({
  List<ChatMessage>? messages,
  bool? isLoading,
  bool? isRestoring,
  bool? isReadOnly,
  String? error,
}) {
  return ChatState(
    messages: messages ?? this.messages,
    isLoading: isLoading ?? this.isLoading,
    isRestoring: isRestoring ?? this.isRestoring,
    isReadOnly: isReadOnly ?? this.isReadOnly,
    error: error,
  );
}