AiChatView class final

Renders a chat conversation with streaming assistant responses.

Assistant messages are shown in a neutral surface bubble; user messages in a primary-colored bubble aligned to the right. While AiChatController/isStreaming is true, a typing indicator is shown and the list auto-scrolls to the latest content.

Inheritance

Constructors

AiChatView({required AiChatController controller, void onSendMessage(String text)?, String inputHint = 'Send a message…', Color? userBubbleColor, Color? assistantBubbleColor, EdgeInsets padding = const EdgeInsets.all(12), ScrollController? scrollController, bool markdownAssistantResponses = false, PrismMarkdownStyle? markdownStyle, Key? key})
const

Properties

assistantBubbleColor → Color?
final
controller → AiChatController
Source of truth for the conversation.
final
hashCode → int
The hash code for this object.
no setterinherited
inputHint → String
Hint text for the input field.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
markdownAssistantResponses → bool
When true, assistant message content is rendered as markdown via PrismMarkdown instead of plain selectable text — ideal for AI responses that contain code blocks, lists and formatting.
final
markdownStyle → PrismMarkdownStyle?
Optional style override passed to PrismMarkdown when markdownAssistantResponses is true.
final
onSendMessage → void Function(String text)?
Called when the user submits the input field. Wire this to your client: call AiChatController/sendUserMessage, then stream the provider events into the controller.
final
padding → EdgeInsets
Outer padding of the view.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollController → ScrollController?
Optional external scroll controller (auto-scroll works out of the box).
final
userBubbleColor → Color?
Bubble colors — defaults derive from the ambient theme.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<AiChatView>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited