Skip to content

FlowChatScreen is the chat surface assembled: a bounded thread above a composer, centred on a readable rail (760 by default), with a zero state for the conversation that hasn’t started and a jump-to-latest button once you’ve scrolled back through history.

Assemble the surface
FlowChatScreen(
empty: messages.isEmpty,
greeting: FlowGreeting(icon: Icons.wb_twilight, text: 'Good afternoon'),
suggestions: FlowSuggestionGroup(
layout: FlowSuggestionLayout.column,
suggestions: starters,
),
thread: FlowThread(messages: messages, controller: controller),
composer: FlowComposer(onSend: send),
threadController: controller,
)

The screen accepts a built FlowThread and FlowComposer rather than their data, so it stays correct as those components grow. What it adds is the one thing every host would otherwise have to know: the bounded height a thread needs, the width caps, and where the zero state’s pieces go — the composer lifts to the vertical centre on wide layouts and stays docked on compact ones.

It builds no Scaffold and no app bar. Drop it in a scaffold body and the host keeps the chrome, the background, and the keyboard inset. Pass composer: null for a read-only surface — an archived thread, a shared transcript.

Pass the same ScrollController to the thread and to threadController: — taking finished widgets means the screen can’t reach in and attach its own. Null leaves the button out entirely.

  • thread — usually a FlowThread, given the bounded height it needs. Null renders an empty thread: a conversation nobody has spoken in yet is a real state of a chat, so the surface stands up on its own.
  • composer — null renders no input: a read-only surface.
  • empty + greeting + suggestions — the zero state; the host flips empty (typically messages.isEmpty).
  • header — optional full-bleed bar above the thread; aboveComposer pins a strip between the thread and the input.
  • threadController, jumpToLatestTooltip — the jump-to-latest button and its host-localized label.
  • maxContentWidth (760), emptyComposerWidth (640), emptySuggestionsWidth (480), padding — the rail and the zero state’s width caps.