AiChatWidget constructor
const
AiChatWidget({
- Key? key,
- required ChatUser currentUser,
- required ChatUser aiUser,
- required ChatMessagesController controller,
- required void onSendMessage(),
- List<
ChatMessage> ? messages, - InputOptions? inputOptions,
- MessageOptions? messageOptions,
- MessageListOptions? messageListOptions,
- List<
ChatUser> ? typingUsers, - bool readOnly = false,
- QuickReplyOptions? quickReplyOptions,
- ScrollToBottomOptions? scrollToBottomOptions,
- ScrollController? scrollController,
- WelcomeMessageConfig? welcomeMessageConfig,
- List<
ExampleQuestion> exampleQuestions = const [], - bool persistentExampleQuestions = false,
- bool enableAnimation = true,
- double? maxWidth,
- LoadingConfig? loadingConfig,
- PaginationConfig? paginationConfig,
- EdgeInsets? padding,
- bool enableMarkdownStreaming = true,
- Duration streamingDuration = const Duration(milliseconds: 30),
- String aiName = 'AI',
- ScrollBehaviorConfig? scrollBehaviorConfig,
- VoiceOptions? voiceOptions,
Implementation
const AiChatWidget({
super.key,
// Required parameters similar to Dila
required this.currentUser,
required this.aiUser,
required this.controller,
required this.onSendMessage,
// Optional parameters, similar to Dila's approach
this.messages,
this.inputOptions,
this.messageOptions,
this.messageListOptions,
this.typingUsers,
this.readOnly = false,
this.quickReplyOptions,
this.scrollToBottomOptions,
this.scrollController,
// Optional specific to AI functionality
this.welcomeMessageConfig,
this.exampleQuestions = const [],
this.persistentExampleQuestions = false,
this.enableAnimation = true,
this.maxWidth,
this.loadingConfig,
this.paginationConfig,
this.padding,
this.enableMarkdownStreaming = true,
this.streamingDuration = const Duration(milliseconds: 30),
this.aiName = 'AI',
// Scroll behavior configuration
this.scrollBehaviorConfig,
// New parameters
this.voiceOptions,
});