ChatWidget constructor
const
ChatWidget({
- Key? key,
- required String domain,
- required String chatbotId,
- ChatTheme? theme,
- void onMessageSent(
- String message
- void onResponseReceived(
- String response
- void onCitationsReceived()?,
- void onThreadIdReceived(
- String threadId
- void onError(
- dynamic error
- List<
ChatMessage> ? initialMessages, - String? inputPlaceholder,
- IconData? sendButtonIcon,
- bool showTimestamps = false,
- bool useThemeOverride = false,
- bool showCitations = false,
- 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
});