Skip to content

MessageList

A conversation transcript: one row per message, prefixed and colored by role ([user], [assistant], [tool]…).

See also: LogRegion for log output with severities.

Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.

MessageList(
showTimestamp: false,
messages: const <MessageEntry>[
MessageEntry(text: 'Add a --version flag.', role: MessageRole.user),
MessageEntry(
text: "I'll read the CLI and pubspec first.",
role: MessageRole.assistant,
),
MessageEntry(text: 'Read lib/main.dart', role: MessageRole.tool),
MessageEntry(text: 'Read pubspec.yaml', role: MessageRole.tool),
MessageEntry(
text:
'Found version 1.4.0 in pubspec. Adding a --version flag '
'that prints it and exits.',
role: MessageRole.assistant,
),
MessageEntry(
text: 'Edit lib/main.dart (+8 −0)',
role: MessageRole.tool,
),
MessageEntry(text: 'dart test', role: MessageRole.tool),
MessageEntry(
text: 'All 12 tests pass. `myapp --version` prints 1.4.0.',
role: MessageRole.assistant,
),
MessageEntry(text: 'Ship it 🚀', role: MessageRole.user),
],
)

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.

ParameterTypeDefaultDescription
messages:List<MessageEntry>requiredSource messages to render and copy.
controller:MessageListController?—External selection and tail-follow controller.
focusNode:FocusNode?—Focus node used for keyboard navigation.
autofocus:boolfalseWhether the list should request focus when mounted.
semanticLabel:String'Messages'Semantic label (the accessibility name; not rendered) for the message list.
showPrefix:booltrueWhether 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.
showTimestamp:boolfalsePrefix each row with the message’s MessageEntry.timestamp as a local HH:mm:ss clock, 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.
maxLineLength:int?1000Cuts each message to this many characters, with no ellipsis, on screen and when copied; null never cuts. The prefix and timestamp don’t count.
copySelection:booltrueWhether Ctrl+C (and the semantic copy action) copies the selected message.
copyOptions:MessageListCopyOptionsconst MessageListCopyOptions()Clipboard/export options for selected-message copy.
onCopy:void Function(MessageListCopyResult result)?—Called after a copy attempt completes.

MessageList is defined in packages/fleury/lib/src/catalog/message_list.dart.

Category: Agent surfaces · All widgets