MessageList class
A conversation transcript: one row per message, prefixed and colored by
role ([user], [assistant], [tool]…).
By default the list follows the tail as messages stream in: scrolling up to read history pauses following, and End or MessageListController.scrollToBottom resumes it. Up and Down move the selected message; PageUp, PageDown, and Home jump; clicking a message selects it. Ctrl+C copies the selected message (see copySelection and copyOptions). MessageListController owns selection and the tail-follow switch.
- Inheritance
-
- Object
- Widget
- StatefulWidget
- MessageList
- Available extensions
Constructors
-
MessageList({Key? key, required List<
MessageEntry> messages, MessageListController? controller, FocusNode? focusNode, bool autofocus = false, String semanticLabel = 'Messages', bool showPrefix = true, bool showTimestamp = false, int? maxLineLength = 1000, bool copySelection = true, MessageListCopyOptions copyOptions = const MessageListCopyOptions(), void onCopy(MessageListCopyResult result)?}) -
const
Properties
- autofocus → bool
-
Whether the list should request focus when mounted.
final
- controller → MessageListController?
-
External selection and tail-follow controller.
final
- copyOptions → MessageListCopyOptions
-
Clipboard/export options for selected-message copy.
final
- copySelection → bool
-
Whether Ctrl+C (and the semantic copy action) copies the selected
message.
final
- focusNode → FocusNode?
-
Focus node used for keyboard navigation.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
finalinherited
- maxLineLength → int?
-
Cuts each message to this many characters, with no ellipsis, on screen
and when copied; null never cuts. The prefix and timestamp don't count.
final
-
messages
→ List<
MessageEntry> -
Source messages to render and copy.
final
- onCopy → void Function(MessageListCopyResult result)?
-
Called after a copy attempt completes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String
-
Semantic label (the accessibility name; not rendered) for the message list.
final
- showPrefix → bool
-
Whether each row shows a
[role author]prefix, such as[assistant](the author appears only when set), before the message's text. A timestamp shown by showTimestamp comes before the prefix.final - showTimestamp → bool
-
Prefix each row with the message's MessageEntry.timestamp as a
local
HH:mm:ssclock, when one is set. Off by default — a chat transcript usually doesn't want it, but agent/log views do. Rows without a timestamp are left unprefixed (no spacer), so a mixed list stays aligned only where times exist.final
Methods
-
animate(
{Duration? duration, Curve? curve, Object? trigger, bool repeat = false}) → Animate -
Available on Widget, provided by the AnimateExtension extension
Starts an Animate chain over this widget.duration/curveapply to the whole chain. With notriggerit plays on mount; with a non-null trigger it rests on mount and replays whenever the token changes. -
createElement(
) → StatefulElement -
Creates the Element that will mount this widget into the tree.
inherited
-
createState(
) → State< MessageList> -
Creates the mutable state for this widget at the current location in
the tree. Called exactly once per StatefulElement instance.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited