AgentConversation class

The scrolling transcript of an Agent conversation.

Each child is one turn, usually an AgentTurn: the reader's message and everything the assistant did in reply. The spec spaces turns apart by AgentConversationSpec.turnSpacing and the blocks inside an AgentTurn by AgentConversationSpec.blockSpacing.

The transcript keeps its live edge with an AgentLiveEdgeController: it follows growing output until the reader scrolls back, and then offers a way back to the latest output. That button animates in and out, and the return scrolls, except under reduced motion; activating it from the keyboard moves focus to the transcript.

The transcript takes focus as one stop and scrolls with the arrow keys, Page Up, Page Down, Home and End. busy reports work in progress to assistive technology without making the transcript a live region.

Inheritance

Constructors

AgentConversation({Key? key, required List<Widget> children, Widget? empty, AgentLiveEdgeController? liveEdge, ScrollController? scrollController, bool busy = false, String busyLabel = 'Busy', String semanticLabel = 'Conversation', bool showLatestButton = true, String latestLabel = 'Scroll to latest', AgentGlyphBuilder? glyphBuilder, IconButtonStyler latestStyle = const IconButtonStyler.create(), AgentConversationStyler style = const AgentConversationStyler.create(), AgentConversationSpec? styleSpec})
Creates a transcript of children, one per turn.
const
AgentConversation.builder({Key? key, required int itemCount, required IndexedWidgetBuilder itemBuilder, ChildIndexGetter? findChildIndexCallback, Widget? empty, AgentLiveEdgeController? liveEdge, ScrollController? scrollController, bool busy = false, String busyLabel = 'Busy', String semanticLabel = 'Conversation', bool showLatestButton = true, String latestLabel = 'Scroll to latest', AgentGlyphBuilder? glyphBuilder, IconButtonStyler latestStyle = const IconButtonStyler.create(), AgentConversationStyler style = const AgentConversationStyler.create(), AgentConversationSpec? styleSpec})
Creates a transcript that builds its itemCount turns lazily.
const

Properties

busy → bool
Whether the assistant is working, reported as busyLabel.
final
busyLabel → String
The semantic value while busy.
final
children → List<Widget>?
The turns, oldest first.
final
empty → Widget?
Shown instead of the transcript while it has no turns.
final
findChildIndexCallback → ChildIndexGetter?
Finds the current index of the turn whose key is given, for the AgentConversation.builder form.
final
glyphBuilder → AgentGlyphBuilder?
Draws AgentGlyph.latest; defaults to the nearest AgentGlyphs.
final
hashCode → int
The hash code for this object.
no setterinherited
itemBuilder → IndexedWidgetBuilder?
Builds the turn at an index, oldest first.
final
itemCount → int?
How many turns itemBuilder builds.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
latestLabel → String
The accessible name of the way back to the latest output.
final
latestStyle → IconButtonStyler
The style of the way back to the latest output.
final
liveEdge → AgentLiveEdgeController?
The live edge to follow; when null, the transcript owns one.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollController → ScrollController?
The scroll controller of the transcript; when null, it owns one.
final
semanticLabel → String
The transcript's accessible name.
final
showLatestButton → bool
Whether a reader away from the live edge is offered a way back.
final
style → AgentConversationStyler
The transcript's style.
final
styleSpec → AgentConversationSpec?
A resolved spec that bypasses style.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<AgentConversation>
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

Static Methods

blockSpacingOf(BuildContext context) → double
The spacing between the blocks of a turn, from the nearest AgentConversation; zero outside one.