Chat screen
The assembled surface — thread above composer on a centred rail, with a zero state and jump-to-latest.
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.
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,)It takes finished widgets
Section titled “It takes finished widgets”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.
Body-only
Section titled “Body-only”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.
Jump to latest
Section titled “Jump to latest”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.
Key API
Section titled “Key API”thread— usually aFlowThread, 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 flipsempty(typicallymessages.isEmpty).header— optional full-bleed bar above the thread;aboveComposerpins 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.