ChatWidget constructor

const ChatWidget({
  1. Key? key,
  2. required String domain,
  3. required String chatbotId,
  4. ChatTheme? theme,
  5. void onMessageSent(
    1. String message
    )?,
  6. void onResponseReceived(
    1. String response
    )?,
  7. void onCitationsReceived(
    1. List<Map<String, dynamic>> citations
    )?,
  8. void onThreadIdReceived(
    1. String threadId
    )?,
  9. void onError(
    1. dynamic error
    )?,
  10. List<ChatMessage>? initialMessages,
  11. String? inputPlaceholder,
  12. IconData? sendButtonIcon,
  13. bool showTimestamps = false,
  14. bool useThemeOverride = false,
  15. bool showCitations = false,
  16. bool isEnabled = true,
})

Implementation

const ChatWidget({
  super.key,
  required this.domain,
  required this.chatbotId,
  this.theme,
  this.onMessageSent,
  this.onResponseReceived,
  this.onCitationsReceived, // Add callback
  this.onThreadIdReceived, // Add callback
  this.onError,
  this.initialMessages,
  this.inputPlaceholder,
  this.sendButtonIcon,
  this.showTimestamps = false,
  this.useThemeOverride = false,
  this.showCitations = false, // Default citations off
  this.isEnabled = true, // Default enabled
});