flow_ui 0.2.0
flow_ui: ^0.2.0 copied to clipboard
Flow UI is an open-source Flutter UI library to build production-grade Chat & AI assistant interfaces.
Changelog #
0.2.0 #
- Typography — title and label roles now carry an emphasised cut
(
titleLargeEmphasised/labelLargeEmphasised, and the medium/small pair for each). The standard scale sizes and line heights are retuned to the design file: display at 1.15, headline at 1.2, title/label at 1.3. CompactFlowGreetingusestitleMediuminstead of a one-off 21. - Breaking: constructing
FlowTypography(...)now requires the new title and label emphasised styles.FlowTypography.standardandcopyWithcover the usual host paths; label sizes also step up one rung (16 / 14 / 12). - Code block —
FlowCodeBlock, and aFlowCodePartmessage part rendered byFlowMessage/FlowThreadwith copy intent surfaced ononCodeCopy. Highlighting is built in and synchronous (Dart, JSON, JavaScript/TypeScript, Python, shell, YAML, HTML, CSS and SQL; host-extensible viaFlowCodeLanguage.register), colored by newFlowSyntaxColorstheme tokens. The package now also bundles Geist Mono (three weights, SIL OFL) behind newcode/codeInlinetypography roles —withFontFamily()no longer touches the mono roles; swap those withwithCodeFontFamily(). - Error state —
FlowErrorState(error glyph, host-written message, retry pill) and aFlowErrorPartmessage part, withonRetry/errorTitle/retryLabelthreaded throughFlowMessageandFlowThread. - Markdown —
FlowMarkdown, assistant prose typeset by a built-in parser (no new dependency): headings on the existing type ramp, emphasis, inline code on thecodeInlinerole as a rounded chip painted under the glyphs — wrapping keeps only the outer corners rounded — links reporting intent throughonLinkTap(barehttps://,http://andwww.URLs autolink with GFM's trimming rules), nested lists, quotes, rules, tables with alignment and overflow scroll, and fenced code rendered byFlowCodeBlock— sharing theFlowCodePartcopy contract. Streaming input may end mid-construct and renders gracefully, with the trailing paragraph revealing character by character. - Streaming motion — markdown reveals through one sequenced frontier: nothing renders below the animating block, fences, tables and rules ease in with height and opacity when the frontier reaches them, and pacing keeps the frontier within the reveal's lag bound on fast streams. Growth is eased in layout — the revealing paragraph gains each wrapped line over a beat — so a thread pinned to the newest message moves continuously instead of stepping a line-height at a time. Reduced-motion settings render statically.
- Breaking: assistant text parts now render as markdown by default.
Hosts whose assistant text is literal pass
markdown: falseonFlowThreadorFlowMessage; user bubbles and system notices are unaffected. - Keyboard — taps landing on the chat surface itself (dead space,
the thread, a settled message) now dismiss the keyboard, and scrolling
the thread dismisses it too (
FlowThread.keyboardDismissBehavior, default on-drag) — the chat conventions. Interactive children keep their taps. - Thread — a conversation that still fits its viewport now reads from
the top, the AI-app convention, instead of hugging the composer with
empty space above. Once it outgrows the viewport the thread anchors to
the newest message as before. A new
messageFooterbuilder fills each default message's footer slot (an actions row, a timestamp) without replacing the whole message the waymessageBuilderdoes. Default padding now gives the conversation 40 above and below (16 at the sides, all overridable throughpadding). - Chat View — the thread's scrollbar rides the surface's edge
instead of hugging the centred rail, and the jump-to-latest button
sits on an outlined, softly lifted
surfacedisc rather than a translucent wash. - Pill —
FlowPill, a removable pill showing an enabled tool or mode in the composer's action row: host-passed icon, label and tooltips, removal intent ononRemove, and a label that auto-drops to the icon-only form on phones (showLabelforces either). - Breaking:
FlowComposer.placeholdernow defaults to 'How can I help you today?' — the one string the package ships. Hosts that want an empty field must pass an explicitplaceholder: null; localized hosts keep passing their own copy. - Breaking:
FlowChatView.composeris now required — still nullable, so a read-only surface passes an explicitcomposer: nullinstead of omitting it. Building the view with nothing to show at all (no thread, composer, header, or zero state) now asserts in debug builds rather than rendering a blank screen. - Breaking:
FlowChatScreenis renamed toFlowChatView. The widget was never a screen — it is body-only and embeddable, and upcoming surfaces (side panel, modal) will host it — so the name now follows Flutter's convention for embeddable composites. Rename call sites; the API is unchanged. - Breaking: a failed assistant turn no longer recolors its content
into an
errorContainerbubble — parts keep their normal ink and the turn closes with an error card (a default one when noFlowErrorPartis present). The user bubble's error treatment is unchanged. - Breaking: migrated from
package:flutter/material.darttopackage:material_ui(Material's home since Flutter 3.47) — no API changes, but the two Materials are distinct types, so the host app must migrate too:dart fix --apply --code=migrate_design_widgetson Flutter 3.44+, or pin flow_ui 0.1.x.
0.1.0 #
First public release — the assistant UI component library for Flutter, with zero third-party dependencies and nothing model-facing.
Ships with:
- Theme —
FlowThemedesign tokens (colors + typography) as aThemeExtension, light and dark presets, bundled Figtree typeface. - Message & Thread — ink-wash user bubble, plain assistant, error state,
typed content parts with a
FlowCustomPartextension seam. - Streaming — animated text reveal, thinking indicator, shimmer text.
- Message actions — copy / regenerate / edit / feedback presets.
- Composer — multiline input with send/stop, attachments strip, and leading/trailing action slots.
- Menus —
FlowMenu(groups, submenus, toggles) andFlowModelSelector(effort + overflow submenus); anchored card on desktop, sheet on phones. - Attachments — image and file tiles with type pill, plus a full-screen preview with zoom and paging.
- Suggestions — plain and outlined starters in scroll, wrap, or column
layouts, with
FlowGreetingfor the zero state. - Chat Screen — the composed surface: centred 760 rail, zero state with lifted composer, jump-to-latest.
0.0.1 #
Initial scaffold.