tui library TUI

Interactive TUI framework (Bubble Tea for Dart).

This library provides a framework for building interactive terminal applications using the Elm Architecture (Model-Update-View).

Core Components

  • Model: Represents the state of your application.
  • Update: A function that handles messages and returns a new model and commands.
  • View: A function that renders the current model into a string.
  • Program: The runtime that manages the event loop and rendering.
  • Bubbles: Reusable interactive widgets like text inputs, spinners, and lists.

Quick Start

import 'package:artisanal/tui.dart';

class CounterModel implements Model {
  final int count;
  CounterModel([this.count = 0]);

  @override
  Cmd? init() => null;

  @override
  (Model, Cmd?) update(Msg msg) {
    return switch (msg) {
      KeyMsg(key: Key(type: KeyType.up)) =>
        (CounterModel(count + 1), null),
      KeyMsg(key: Key(type: KeyType.down)) =>
        (CounterModel(count - 1), null),
      KeyMsg(key: Key(type: KeyType.runes, runes: [0x71])) =>
        (this, Cmd.quit()),
      _ => (this, null),
    };
  }

  @override
  String view() => 'Count: \$count\n\nUse ↑/↓ to change, q to quit';
}

void main() async {
  await runProgram(CounterModel());
}

The Elm Architecture

The TUI runtime follows The Elm Architecture (TEA) pattern, which separates state, logic, and presentation:

  • Model: The state of your application. It should be immutable.
  • Update: A pure function that takes a Msg and the current Model, and returns a new Model and an optional Cmd.
  • View: A pure function that takes the Model and returns a String (or a View object for advanced metadata) representing the UI.
┌─────────────────────────────────────────────────────┐
│                     Program                          │
│                                                      │
│    ┌───────┐     ┌────────┐     ┌──────┐            │
│    │ Model │────▶│ update │────▶│ view │            │
│    └───────┘     └────────┘     └──────┘            │
│        ▲              │              │               │
│        │              │              ▼               │
│        │         ┌────────┐     ┌────────┐          │
│        └─────────│  Cmd   │     │ Screen │          │
│                  └────────┘     └────────┘          │
│                       │                              │
│                       ▼                              │
│                  ┌────────┐                          │
│                  │  Msg   │◀──── User Input          │
│                  └────────┘                          │
└─────────────────────────────────────────────────────┘

Commands and Messages

  • Msg: Represents an event (key press, timer tick, network response).
  • Cmd: Represents an effect to be performed by the runtime (quitting, sending a message, running an external process).

Use BatchMsg to group multiple messages, and BatchCmd to group multiple commands.

Program Lifecycle

  1. Initialization: The Program starts, calls Model.init(), and executes the returned Cmd.
  2. Event Loop: The program waits for input (stdin, signals, or commands).
  3. Update: When a Msg arrives, Model.update(msg) is called.
  4. Render: If the model changed, Model.view() is called and the result is rendered to the terminal.
  5. Termination: The program exits when a QuitMsg is received or Cmd.quit() is executed.

Rendering and Performance

Artisanal supports multiple rendering strategies:

  • Standard: Simple ANSI output for basic terminals.
  • Ultraviolet: High-performance diff-based rendering with cell buffers.
  • ANSI Compression: Minimizes output by removing redundant SGR sequences.

Configure these via ProgramOptions.

The TUI runtime follows The Elm Architecture (TEA) pattern, which separates state, logic, and presentation:

  • Model: The state of your application. It should be immutable.
  • Update: A pure function that takes a Msg and the current Model, and returns a new Model and an optional Cmd.
  • View: A pure function that takes the Model and returns a String (or a View object for advanced metadata) representing the UI.
┌─────────────────────────────────────────────────────┐
│                     Program                          │
│                                                      │
│    ┌───────┐     ┌────────┐     ┌──────┐            │
│    │ Model │────▶│ update │────▶│ view │            │
│    └───────┘     └────────┘     └──────┘            │
│        ▲              │              │               │
│        │              │              ▼               │
│        │         ┌────────┐     ┌────────┐          │
│        └─────────│  Cmd   │     │ Screen │          │
│                  └────────┘     └────────┘          │
│                       │                              │
│                       ▼                              │
│                  ┌────────┐                          │
│                  │  Msg   │◀──── User Input          │
│                  └────────┘                          │
└─────────────────────────────────────────────────────┘
  • Msg: Represents an event (key press, timer tick, network response).
  • Cmd: Represents an effect to be performed by the runtime (quitting, sending a message, running an external process).

Use BatchMsg to group multiple messages, and BatchCmd to group multiple commands.

  1. Initialization: The Program starts, calls Model.init(), and executes the returned Cmd.
  2. Event Loop: The program waits for input (stdin, signals, or commands).
  3. Update: When a Msg arrives, Model.update(msg) is called.
  4. Render: If the model changed, Model.view() is called and the result is rendered to the terminal.
  5. Termination: The program exits when a QuitMsg is received or Cmd.quit() is executed.

Artisanal supports multiple rendering strategies:

  • Standard: Simple ANSI output for basic terminals.
  • Ultraviolet: High-performance diff-based rendering with cell buffers.
  • ANSI Compression: Minimizes output by removing redundant SGR sequences.

Configure these via ProgramOptions.

Classes

AccentPanel
A panel with a colored vertical accent stripe on one side.
AccentPanelThemeData
Theme data for AccentPanel widgets.
Accordion
ActionButton
A compact, styled button designed for use in dialog footers and inline prompt panels.
ActionChip
Flutter-style action chip.
AdaptiveChromaTheme
An adaptive syntax highlighting theme that selects between light and dark variants based on terminal background.
Alert
A fluent builder for creating styled alerts.
AlertBox
AlertComponent
An alert/notice block component.
Align
Alignment
AlwaysStoppedAnimation<T>
An Animation that is always stopped at a given value.
Animatable<T>
Transforms a double (typically from an Animation<double>) into a value of type T.
AnimatedBuilder
A general-purpose widget that rebuilds whenever a Listenable notifies.
AnimatedTint
A widget that applies an animated color tint over its child.
AnimatedWidgetBaseState<T extends ImplicitlyAnimatedWidget>
Base state class for ImplicitlyAnimatedWidget.
Animation<T>
An animation with a value of type T.
AnimationController
A TEA-native animation controller.
AnimationTickMsg
Message delivered on each animation frame tick.
AnsiRenderer
Renders markdown AST nodes to ANSI-styled terminal output.
AnsiRendererOptions
Configuration options for ANSI markdown rendering.
AnticipateConfig
Configuration for anticipate/autocomplete component.
AnticipateKeyMap
Key map for anticipate navigation and selection.
AnticipateModel
Anticipate model for autocomplete input.
AsciiFont
Abstract base class for ASCII art fonts.
AsciiGlyph
Represents a single ASCII art character glyph.
AsciiText
A widget that renders text using large ASCII art font glyphs.
AsyncSnapshot<T>
BackgroundColorMsg
Message containing the terminal's background color.
Badge
BarChart
A vertical bar chart (histogram) widget.
BatchMsg
Message containing multiple messages to be processed sequentially.
BlockFocus
A widget that blocks keyboard events from reaching its children.
BorderRadius
Box
A boxed message component.
BoxBuilder
A fluent builder for creating styled boxes.
BoxConstraints
Box constraints for layout.
BoxDecoration
BufferedTuiRenderer
A renderer that buffers output for efficient writes.
BuildContext
An opaque handle to location in the widget tree.
Builder
A widget that delegates its build to a callback.
BuildOwner
Schedules and rebuilds dirty elements.
BulletList
A bullet list component.
Button
CapabilityMsg
Message sent when a terminal capability is reported.
Card
Center
ChangeNotifier
A Listenable implementation that stores listeners and can notify them.
ChartBuilder
A convenience widget that rebuilds whenever a ChartModel changes.
ChartModel
An observable data model for driving chart widget rebuilds.
ChartSeries
A named data series for use in charts that support multiple series.
Checkbox
CheckboxListTile
Flutter-style checkbox list tile.
CheckedPopupMenuItem<T>
A selectable menu entry with a check indicator.
Chip
Flutter-style non-interactive chip.
ChoiceChip
Flutter-style single-select chip.
ChromaTheme
Configuration for syntax highlighting colors.
CircularProgressIndicator
Flutter-style circular progress indicator.
ClearScreenMsg
Internal message to clear the screen.
ClipboardMsg
Clipboard content message.
ClipboardSetMsg
Message emitted after a best-effort clipboard write is attempted.
ClipRect
A widget that clips its child to its allocated size.
Cmd TUI
A command that produces a message asynchronously.
ColoredBox
A widget that fills its area with a single solid color.
ColorProfileMsg
Message sent when the terminal color profile is detected or changed.
Column
ColumnComponent
A component that renders with a newline after each child.
ColumnsComponent
A multi-column layout component.
CommandPalette
A searchable, grouped list displayed in a modal overlay.
CommandPaletteItem
A single item in a CommandPalette.
CommandPaletteThemeData
Theme data for CommandPalette widgets.
Comment
A fluent builder for creating styled comments.
CommentComponent
A comment component (dimmed text with // prefix).
CommonKeyBindings
Commonly used key bindings for navigation.
ComponentBoxChars
Box drawing characters for component system.
CompositeComponent
A component that composes multiple child components.
CompositeModel
A model that wraps another model, useful for composition.
ConditionalStep
Conditional wizard step.
ConfirmCancelledMsg
Message sent when confirmation is cancelled.
ConfirmKeyMap
Key bindings for the confirm component.
ConfirmModel
A confirmation (yes/no) component following the Model architecture.
ConfirmResultMsg
Message sent when confirmation is made.
ConfirmStep
Confirmation wizard step.
ConfirmStyles
Styles for the confirm component.
ConstantTween<T>
A tween that always returns the same constant value.
ConstrainedBox
Container
CountdownModel
A countdown model built on top of TimerModel.
Cubic
A cubic Bezier curve defined by two control points.
CursorBlinkMsg
Message indicating the cursor should toggle its blink state.
CursorColorMsg
Message containing the terminal's cursor color.
CursorModel
A blinking cursor widget for text input components.
Curve
A mapping of the unit interval to the unit interval.
Curves
A collection of common animation curves.
CurveTween
An Animatable that applies a Curve to the input value.
CustomMsg<T>
Message wrapper for custom user-defined messages.
DataTable
A simple data table widget that renders tabular data with column headers, row separators, and optional theming.
DebugOverlay
A debug overlay that displays rendering metrics.
DebugOverlayModel
Draggable render-metrics overlay for debugging TUI performance.
DecoratedBox
A widget that paints a Decoration either behind or in front of its child.
Decoration
DefaultItemDelegate
Default item delegate with simple rendering.
DefinitionList
A fluent builder for creating styled definition lists.
DefinitionListComponent
A definition list component (term: description pairs).
DestructiveConfirmModel
A destructive confirmation component that requires typing to confirm.
DialogAlert
A simple alert dialog with a title, message, and OK button.
DialogConfirm
A simple yes/no confirmation dialog.
DialogPrompt
A dialog with a text input field.
DialogSelect<T>
A generic searchable, grouped selection list dialog.
DialogSelectItem<T>
A single item in a DialogSelect list.
DialogStack
Manages a stack of modal dialogs.
DialogStackState
State for DialogStack, providing the push/pop/replace/clear API.
DialogThemeData
Theme data for dialog widgets (DialogConfirm, DialogAlert, DialogPrompt, DialogSelect).
DiffFile
A file entry in a parsed diff.
DiffLine
A single parsed line from a unified diff.
DiffStyles
Configuration for diff styling.
DisableBracketedPasteMsg
Internal message to disable bracketed paste.
DisableMouseMsg
Internal message to disable mouse tracking.
DisableReportFocusMsg
Internal message to disable focus reporting.
DisplayComponent
Base type for display-only UI building blocks.
Divider
DoubleTapGestureRecognizer
Recognizes double-tap gestures.
DoubleTween
An explicit double tween (mostly for documentation clarity).
DragEndDetails
Details for the end of a drag gesture.
DragGestureRecognizer
Recognizes drag gestures.
DragStartDetails
Details for the start of a drag gesture.
DragUpdateDetails
Details for a drag update event.
Drawer
Flutter-style dropdown button wrapper.
Flutter-style dropdown menu item.
EdgeInsets
ElasticInCurve
An elastic curve that overshoots and then oscillates at the start.
ElasticInOutCurve
An elastic curve that overshoots and oscillates at both ends.
ElasticOutCurve
An elastic curve that overshoots and then oscillates at the end.
Element
A mounted widget instance in the tree.
ElementTree
Owns an element tree and provides rendering.
ElevatedButton
Flutter-style elevated button wrapper.
EnableBracketedPasteMsg
Internal message to enable bracketed paste.
EnableMouseAllMotionMsg
Internal message to enable mouse all motion tracking.
EnableMouseCellMotionMsg
Internal message to enable mouse cell motion tracking.
EnableReportFocusMsg
Internal message to enable focus reporting.
EnterAltScreenMsg
Internal message to enter alt screen.
ErrorThrowingWidget
A widget that deliberately throws during build.
EveryCmd
A repeating command that fires at regular intervals.
ExceptionComponent
An exception renderer component.
ExecProcessMsg
Message signaling that an external process should be executed.
ExecResult
Result of executing an external process.
ExitAltScreenMsg
Internal message to exit alt screen.
Expanded
ExpansionTile
Flutter-style expansion tile built on top of ListTile.
FadeModalBarrier
A modal barrier that fades in/out with an animated opacity.
FadeTint
A widget that fades a tint in or out over its child.
FileEntry
A file entry with cached stat information.
FileImage
An ImageProvider that loads an image from a file path.
FilePickerErrorMsg
Error message when reading a directory fails.
FilePickerKeyMap
Key mappings for the file picker component.
FilePickerModel
A file picker model for navigating and selecting files.
FilePickerReadDirMsg
Message sent when directory contents are read.
FilePickerStyles
Styles for the file picker component.
FilledButton
Flutter-style filled button wrapper.
FilterChip
Flutter-style multi-select chip.
FilteredItem
Filtered item with match information.
FilteredSearchItem<T>
A filtered item with its original index and match positions.
FilterMatchesMsg
Filter matches message.
Flex
Flexible
FlexParentData
Parent-data used by flex containers for each child render object.
FlippedCurve
A curve that is the reverse of another curve.
Focusable
A widget that responds to keyboard input when focused.
FocusController
Controls which focusable widget is currently focused.
FocusMsg
Message sent when focus is gained or lost.
FocusScope
Provides a FocusController to descendants.
ForegroundColorMsg
Message containing the terminal's foreground color.
Frame
FrameTickModel
Optional interface for models that want to control frame ticks.
FrameTickMsg
Message sent automatically by the TUI runtime every frame.
FullScreenTuiRenderer
Full-screen renderer using the alternate screen buffer.
FutureBuilder<T>
GestureArenaManager
Manages gesture arenas for conflict resolution.
GestureDetector
GestureRecognizer
Abstract base class for all gesture recognizers.
GitDiffController
Controller for GitDiffViewer.
GitDiffKeyMap
Key bindings for the git diff viewer.
GitDiffModel
A git diff viewer bubble.
GitDiffThemeData
Theme data for GitDiffViewer widgets.
GitDiffViewer
A widget for viewing git diffs with syntax highlighting and scrolling.
Gradient
GroupedDefinitionList
A fluent builder for creating grouped definition lists.
GroupStep
Group of wizard steps.
GutterContext
GutterContext provides context to a GutterFunc.
HBox
HeatmapChart
A 2D heatmap widget that maps grid values to colours via a ChartRamp.
Help
Help information for a key binding.
HelpModel
A help view widget for displaying key bindings.
HelpStyles
Styles for the help view.
HideCursorMsg
Internal message to hide cursor.
HighlightInfo
Describes a text highlight region within the viewport.
HitTestElementEntry
Result of an element-level hit test — pairs an Element with the local coordinates at which its render object was hit.
HitTestEntry
A single entry in a HitTestResult, linking a render object to the local coordinates at which it was hit.
HitTestMouseMsg
Message dispatched to an element when render-tree hit-testing determines that a MouseMsg landed within its render object's bounds.
HitTestResult
Accumulated result of a hit test, ordered deepest-first.
HorizontalTableComponent
A horizontal table component (row-as-headers style).
HyperlinkText
A text widget that renders as a clickable hyperlink using OSC 8 escape sequences in terminals that support them.
Icon
IconButton
Flutter-style icon button wrapper.
IconData
Icons
IgnorePointer
A widget that is invisible to hit-testing.
Image
A widget that displays an image in the terminal.
ImageData
Data class holding a decoded image.
ImageProvider
Abstract base class for providing images to the Image widget.
ImplicitlyAnimatedWidget
Abstract base class for widgets that implicitly animate when their properties change.
InheritedElement
Element implementation for InheritedWidget nodes.
InheritedWidget
A widget that exposes data to descendants.
InlineTuiRenderer
Inline renderer that renders below the current cursor position.
InputChip
Flutter-style input chip.
InterruptMsg
Message sent when an interrupt signal (SIGINT/Ctrl+C) is received.
Interval
An interval that starts and/or ends at a fractional point along the curve.
IntTween
A tween that interpolates between two integers.
ItemDelegate
Item delegate for rendering list items.
Key
Represents a parsed keyboard input event.
KeyBinding
A key binding that maps keys to actions with optional help text.
KeyboardEnhancements
KeyboardEnhancements describes the requested keyboard enhancement features.
KeyboardEnhancementsMsg
Message sent when keyboard enhancements are reported.
KeyboardListener
A widget that calls a callback when a key is pressed.
KeyHint
A small widget that displays a keyboard shortcut key and its label.
KeyMap
A collection of key bindings forming a key map.
KeyMsg
Message sent when a key is pressed.
KeyParser
Parses raw terminal input bytes into Key objects and Msg objects.
Keys
Key constants and utilities for keyboard input handling.
KeyValue
A key-value pair component with dot fill.
Label
LayoutBuilder
A widget that provides its parent's constraints to a builder callback.
LeafRenderObjectWidget
A render object widget with no children.
LimitedBox
A box that limits its size only when it's unconstrained.
LinearProgressIndicator
Flutter-style linear progress indicator.
LineChart
A multi-point line chart widget with optional markers, grid, and axis labels.
LineInfo
LinkComponent
A clickable hyperlink component (OSC 8).
LinkGroupComponent
A group of related links component.
Listenable
An object that maintains a list of listeners.
ListenableBuilder
A widget that rebuilds when a Listenable changes.
ListEnumerator
Defines how list items are explicitly enumerated.
ListItem
Item interface for list items.
ListKeyMap
Key map for list navigation.
ListModel
List model for interactive lists.
ListStyles
Styles for list rendering.
ListTile
ListView
ListViewController
Controller for scroll position in VirtualListView.
LoggingNavigatorObserver
A NavigatorObserver that logs navigation events to the console.
LongPressEndDetails
Details for the end of a long-press gesture.
LongPressGestureRecognizer
Recognizes long-press gestures.
LongPressStartDetails
Details for the start of a long-press gesture.
Markdown
A component that renders markdown to ANSI-styled terminal output.
MarkdownOptions
Configuration options for the Markdown component.
MarkdownText
A widget that renders Markdown content as styled ANSI text.
MediaQuery
MediaQueryData
MemoryImage
An ImageProvider that loads an image from raw bytes.
MetricDisplay
A single-value metric display widget.
ModalRoute<T>
A modal overlay route with an optional barrier.
Model TUI
Abstract interface for TUI application models.
MouseMsg
Message sent for mouse events.
MouseRegion
Msg TUI
Base class for all messages in the TUI runtime.
MultiChildRenderObjectWidget
A render object widget with multiple children.
MultiProgressModel
A model for managing multiple progress bars simultaneously.
MultiSelectionMadeMsg<T>
Message sent when multiple items are selected.
MultiSelectKeyMap
Key bindings for the multi-select component.
MultiSelectModel<T>
A multi-select component following the Model architecture.
MultiSelectStep
Multi-select wizard step.
MultiSelectStyles
Styles for the multi-select component.
A widget that manages a stack of Route objects.
An interface for observing the behavior of a Navigator.
State for Navigator, providing route stack management.
NullTuiRenderer
A renderer that does nothing (for testing).
NumberedList
A numbered list component.
Offset
An offset in terminal cell units (column, row).
Opacity
OpenCodeThemes
All 33 OpenCode themes, ported from the official JSON definitions.
OutlinedButton
Flutter-style outlined button wrapper.
OverflowBox
A widget that imposes different constraints on its child than it gets from its parent, possibly allowing the child to overflow the parent.
Overlay
A widget that manages a stack of OverlayEntry objects.
OverlayEntry
An entry in an Overlay.
OverlayState
State for Overlay, providing methods to insert and remove entries.
Padding
PageRoute<T>
A full-screen page route.
Pagination
PaginatorKeyMap
Key bindings for paginator navigation.
PaginatorModel
A paginator widget for handling pagination state and rendering.
Panel
A fluent builder for creating styled panels.
PanelBox
PanelBoxChars
Box drawing characters for panels and borders.
PanelBoxCharSet
A set of box drawing characters.
PanelComponent
A boxed panel component with optional title.
ParallelCmd
A command that executes multiple commands in parallel through the Program's command execution system.
PasswordCancelledMsg
Message sent when password input is cancelled.
PasswordConfirmModel
A password confirmation component that asks for password twice.
PasswordKeyMap
Key bindings for the password component.
PasswordModel
A password input component following the Model architecture.
PasswordStep
Password input wizard step.
PasswordStyles
Styles for the password component.
PasswordSubmittedMsg
Message sent when password input is submitted.
PasteErrorMsg
Message for paste errors.
PasteMsg
Message sent when bracketed paste content is received.
PauseModel
A simple "press any key" pause model.
PerformanceMetricsSnapshot
Combined snapshot of both runtime and widget-level metrics.
PerformanceOverlay
A simpler variant of DebugOverlay that only shows render timing.
PieChart
A pie or donut chart widget.
Point
3D point helper.
PopBehavior
Configuration for how a Navigator handles pop requests via keyboard.
PopupMenuButton<T>
Flutter-style popup menu button.
PopupMenuDivider<T>
A non-selectable divider entry for PopupMenuButton.
PopupMenuEntry<T>
Base class for entries used in PopupMenuButton.
PopupMenuItem<T>
A selectable menu entry for PopupMenuButton.
Positioned
PrintLineMsg
Message for printing a line above the program output.
Program<M extends Model> TUI
The TUI program runtime.
ProgramInterceptor
Intercepts program messages and lifecycle events.
ProgramOptions
Options for configuring the TUI program.
ProgramReplay
Message replay source for ProgramOptions.replay.
ProgramReplayStep
One replay step for ProgramReplay.script.
ProgressBar
A progress indicator component.
ProgressBarAdvanceMsg
ProgressBarComponent TUI
A progress bar component.
ProgressBarIterateDoneMsg
ProgressBarIterateErrorMsg
ProgressBarModel
A UV-safe progress bar model that can be hosted inside a parent Model.
ProgressBarMsg
ProgressBarSetMsg
ProgressFrameMsg
Message indicating a progress bar animation frame should advance.
ProgressIndicator
ProgressModel
A progress bar widget with optional animation support.
Projectile
A simple projectile integrator mirroring harmonica/projectile.go.
PromptFooterBar
A footer bar for inline prompt panels and dialog bottoms.
ProxyAnimation
An Animation that proxies another animation.
QuitMsg
Internal message signaling that the program should quit.
Radio<T>
RadioListTile<T>
Flutter-style radio list tile.
RangeSlider
Flutter-style range slider for selecting a start/end interval.
RangeValues
Immutable pair of values used by RangeSlider.
Rank
Rank from filtering.
Rect
A rectangle defined by offset + size, in terminal cell units.
RenderAlign
RenderBox
A render object with box constraints.
RenderColumn
A vertical column layout.
RenderConfig TUI
Rendering configuration for display-only UI building blocks.
RenderConstrainedBox
RenderContainer
RenderDelegateBox
A render box that delegates paint to a callback.
RenderIgnorePointer
A render object that never reports a hit, causing hit-testing to skip its subtree and continue to siblings in the parent's child list.
RenderListViewport
Render object backing VirtualListView.
RenderListViewScrollViewport
Render object for _ListViewViewport.
RenderMetrics
Tracks render performance metrics including FPS, frame times, and render durations.
RenderMetricsHolder
Mutable holder for RenderMetrics that WidgetApp updates in-place.
RenderMetricsInjection
A portable render-metrics update payload.
RenderMetricsInjector
Global bus for injecting render metrics from anywhere.
RenderMetricsModel
Optional interface for models that want render metrics updates.
RenderMetricsMsg
Message sent periodically with renderer performance metrics.
RenderMetricsProvider
Provides RenderMetricsHolder to the widget tree via InheritedWidget.
RenderObject
A render object represents a layout/paintable node.
RenderObjectElement
Element for render object widgets.
RenderObjectWidget
Base class for widgets that create render objects.
RenderPadding
RenderRow
A horizontal row layout.
RenderScrollbar
Render object that draws a vertical scrollbar next to or over child content.
RenderSelectableText
A render object that paints text with optional selection highlighting.
RenderSingleChildViewport
Render object for _SingleChildViewport.
RenderSizedBox
RenderStack
RenderText
Renders a text string with constraints.
RenderViewport
Render object backing Viewport.
RenderWrap
RepaintMsg
Message sent to force a repaint of the view.
RepaintRequestMsg
Internal message to request a repaint.
ReplayAction
Replay action schema used by TUI scenario JSON files.
ReplayCoordinateInterceptor
Coordinate interceptor that scales replay mouse coordinates to current runtime window dimensions.
ReplayCustomEvent
Structured custom event embedded in replay actions.
ReplayEventDirective
Hook decision produced for ReplayCustomEvent actions.
ReplayEventMsg
Replay message emitted for custom event actions.
ReplayMouseMsg
Replay-only mouse message marker.
ReplayScenario
Replay scenario document.
ReplayScreen
Screen metadata captured for replay coordinate scaling.
ReplayTraceConversionOptions
Trace conversion options for ReplayTraceConverter.
ReplayTraceConversionResult
Conversion output returned by ReplayTraceConverter.convertFile.
ReplayTraceConverter
Converts TuiTrace logs into replay scenarios.
RequestWindowSizeMsg
Internal message to request window size.
ResumeMsg
Message sent when the program resumes from suspension.
ReverseTween<T>
A tween that evaluates another tween in reverse.
RibbonChart
A stacked area (ribbon) chart widget for visualising multiple data series.
RichText
A widget that displays styled text using a TextSpan tree.
Route<T>
Abstract base class for routes managed by a Navigator.
RouteSettings
Immutable route metadata.
Row
RowComponent
A component that renders children horizontally with a separator.
Rule
A horizontal rule/separator component.
SanitizerOptions
Options for configuring the sanitizer behavior.
SawTooth
A sawtooth curve that repeats count times over the unit interval.
ScrollArea
A convenience widget that wraps SingleChildScrollView with optional sizing and an optional Scrollbar.
Scrollbar
A scrollbar that decorates a scrollable child.
ScrollbarChars
ScrollbarGradient
A vertical gradient for scrollbar tracks or thumbs.
ScrollController
Scroll controller interface for scrollable widgets.
ScrollView
A scrollable container for a single child widget.
SearchCancelledMsg
Message sent when search is cancelled.
SearchKeyMap
Key bindings for the search component.
SearchModel<T>
A search/filter component following the Model architecture.
SearchSelectionMadeMsg<T>
Message sent when a search result is selected.
SearchStyles
Styles for the search component.
Select<T>
SelectableText
A text widget that supports click-drag selection and Ctrl+C copy.
SelectionArea
Provides a shared SelectionController to descendant SelectableText widgets, enabling cross-widget text selection.
SelectionCancelledMsg
Message sent when selection is cancelled.
SelectionController
Manages text selection state independently of scroll.
SelectionMadeMsg<T>
Message sent when an item is selected.
SelectKeyMap
Key bindings for the select component.
SelectModel<T>
A single-select component following the Model architecture.
SelectOption<T>
SelectStep
Single-select wizard step.
SelectStyles
Styles for the select component.
SetWindowTitleMsg
Internal message to set window title.
ShowCursorMsg
Internal message to show cursor.
ShrinkWrap
SimpleExceptionComponent
A simple one-line exception component.
SimpleTuiRenderer
TuiRenderer that writes output without diffing or clearing (nil renderer mode).
SingleChildRenderObjectWidget
A render object widget with a single child.
SingleChildScrollView
A scrollable container for a single child widget.
Size
Size in terminal cell units.
SizedBox
SizedOverflowBox
A widget that is a specific size but passes its original constraints through to its child, which may then overflow.
Slider
Flutter-style slider for selecting a single value.
Spacer
SparklineChart
A compact sparkline widget rendered with Unicode block characters.
Spinner
A spinner animation definition.
SpinnerFrame
A spinner frame component (for use in animations).
SpinnerIndicator
SpinnerModel
A spinner widget for showing loading/activity states.
Spinners
Pre-defined spinner animations.
SpinnerTickMsg
Message indicating a spinner should advance to the next frame.
SplitView
Spring
A stable damped spring integrator (Ryan Juckett formulation) matching charmbracelet/harmonica.
Stack
StackParentData
State<T extends StatefulWidget>
Mutable state for a StatefulWidget.
StatefulElement
Element implementation for StatefulWidget nodes.
StatefulWidget
A widget with mutable state managed by a State object.
StatelessElement
Element implementation for StatelessWidget nodes.
StatelessWidget
A widget with a build method and no mutable state.
StaticComponent
A ViewComponent that only has a view and no state/updates.
StaticWidget
A simple widget that wraps a static string or View.
StatusBar
A horizontal bar that displays a row of KeyHint items.
StatusBarThemeData
Theme data for StatusBar widgets.
StatusMessageTimeoutMsg
Status message timeout message.
StdioTerminal
Standard terminal implementation using dart:io.
StepIndicator
A step-by-step progress indicator widget.
StepItem
A single step in a StepIndicator.
StepTween
A tween that floors the interpolated value to an integer.
StopwatchModel
A stopwatch model that counts up from zero.
StopwatchResetMsg
Message sent to reset the stopwatch.
StopwatchStartStopMsg
Message sent to start or stop the stopwatch.
StopwatchTickMsg
Message sent when the stopwatch ticks.
StreamBuilder<T>
StreamCmd<T>
A command that manages a stream subscription.
StringItem
Simple string item implementation.
StringSinkTuiRenderer
A renderer that writes to a StringSink (for testing).
StyledAsciiText
A convenience wrapper that applies a Style to AsciiText.
StyledBlock
A fluent builder for creating styled blocks (Symfony-style).
StyledBlockComponent
A styled block component (Symfony-style).
StyledText
A styled text component using the context's style.
SuspendMsg
Message signaling the program should suspend (like Ctrl+Z).
Switch
SwitchListTile
Flutter-style switch list tile.
SyntaxHighlighter
Syntax highlighter that converts code to ANSI-styled terminal output.
TabItem
Table
A fluent builder for creating styled tables.
TableComponent
A table component with headers and rows.
TableKeyMap
Key map for table navigation.
TableModel
Table model for interactive tables.
TableStyles
Styles for table rendering.
Tabs
TapDownDetails
Details for a tap-down event.
TapGestureRecognizer
Recognizes single-tap gestures.
TapUpDetails
Details for a tap-up event.
TaskComponent
A task status component (Laravel-style).
TerminalProgressBar
TerminalProgressBar represents the terminal taskbar progress (OSC 9;4).
TerminalState
Terminal state snapshot for saving/restoring.
TerminalThemeState
Tracks terminal theme information (background + dark/light heuristic).
TerminalVersionMsg
Message sent when the terminal version is reported.
Text
TextAreaCursorStyle
TextAreaKeyMap
TextAreaModel
TextAreaPasteErrorMsg
TextAreaPasteMsg
TextAreaStyles
TextAreaStyleState
TextButton
Flutter-style text button wrapper.
TextEditingController
Controls the state of a TextField.
TextEditingValue
The current state of a text field.
TextField
A text input widget supporting single-line and multi-line editing.
TextInputCursorStyle
Style for the cursor.
TextInputKeyMap
Key map for text input navigation and editing.
TextInputModel
Text input model for single-line or multi-line text entry.
TextInputStep
Text input wizard step.
TextInputStyles
Styles for the text input.
TextInputStyleState
Style state for focused and blurred states.
TextModel
A high-level text component that supports selection, scrolling, and wrapping. It is built on top of ViewportModel but defaults to auto-height and soft-wrap.
TextSelection
Range of text that is selected.
TextSpan
Theme
Theme containing semantic colors, text styles, and component themes.
ThemeScope
Provides a theme to descendant widgets via the build context.
Threshold
A curve that jumps from 0.0 to 1.0 when t passes threshold.
TickMsg
Message sent when a timer tick occurs.
TimerModel
A countdown timer model.
TimerStartStopMsg
Message sent to start or stop the timer.
TimerTickMsg
Message sent when the timer ticks.
TimerTimeoutMsg
Internal message sent when timer times out.
Tint
A widget that applies a color tint over its child.
TitledBlockComponent
A simple titled block used by the artisanal-style I/O facade.
Toast
Tooltip
TraceEventRecord
A structured event decoded from one trace log line.
TraceEventType
Structured trace event names emitted by TuiTrace.event.
TraceSpan
A timing span for hierarchical tracing.
Transform
A widget that applies spatial transformations to its child.
Tree
A fluent builder for creating styled trees (lipgloss v2 parity).
TreeChildren
TreeComponent
A tree structure component.
TreeEnumerator
Defines the characters used to draw tree branches.
TreeFilter
TreeNode
TreeNodeChildren
TreeStringData
TreeView
A hierarchical tree view widget.
TreeViewNode
A node in a TreeView widget.
TUIErrorWidget
A widget that displays an error message with red styling.
TuiRenderer TUI
Abstract renderer interface for TUI output.
TuiRendererOptions
Options for configuring the renderer.
TuiTrace
Lightweight debug tracer for TUI frame rendering and message dispatch.
Tween<T extends dynamic>
A linear interpolation between a begin and end value.
TweenSequence<T>
An Animatable that chains multiple tweens end-to-end with proportional durations.
TweenSequenceItem<T>
A single entry in a TweenSequence.
TwoColumnDetail
A fluent builder for creating two-column detail rows.
TwoColumnDetailComponent
A two-column detail component with dot fill.
TwoColumnDetailList
A fluent builder for creating multiple two-column detail rows.
UltravioletTuiRenderer
Ultraviolet-inspired renderer backed by a cell buffer + diffing updates.
UvEventMsg
Raw Ultraviolet event message (only emitted when UV input decoding is enabled).
ValueListenable<T>
A Listenable that exposes a current value.
ValueListenableBuilder<T>
A widget that rebuilds when a ValueListenable changes its value.
ValueNotifier<T>
A ChangeNotifier that holds a single value and notifies when it changes.
VBox
Vector
3D vector helper.
VerticalDivider
A vertical line divider.
View TUI
View represents a terminal view that can contain metadata for terminal control.
ViewComponent
A lightweight, composable TUI component.
Viewport
A string-backed scrollable viewport powered by ViewportModel.
ViewportController
Controller for Viewport.
ViewportKeyMap
Key bindings for viewport navigation.
ViewportModel
A viewport widget for scrollable content.
ViewportScrollPane
ViewState
Stores the view state when navigating into directories.
VirtualListView
A render-object driven list view that only paints visible items.
Visibility
Widget
Base class for composable TUI widgets.
WidgetApp
Runs a widget tree using an element hierarchy.
WidgetElement
Default element for widgets without render objects.
WidgetFrameTiming
Per-frame timing data from the widget layer.
WidgetScrollController
A simple ScrollController for use with SingleChildScrollView, ScrollView, and ListView.
WindowSizeMsg
Message sent when the terminal window is resized.
WizardCancelledMsg
Message sent when the wizard is cancelled.
WizardCompletedMsg
Message sent when the entire wizard is completed.
WizardModel
Wizard model for multi-step forms.
WizardStep
Base class for wizard steps.
WizardStepCompletedMsg
Message sent when a wizard step is completed.
Wrap
Zone
ZoneInBoundsMsg
Message sent when a zone is within bounds of a mouse event.
ZoneInfo
Holds information about the start and end positions of a zone.
ZoneManager
Zone manager for tracking clickable regions in TUI output.

Enums

AccentSide
The side on which the accent stripe is drawn.
AlertDisplayStyle
Alert display style.
AlertType
Alert types.
AlertVariant
AnimationStatus
The status of an animation.
AsyncConnectionState
Axis
BlockStyleType
Block style types.
BorderStyle
Border styles for boxes.
BoxAlign
Alignment for box content.
BoxFit
How an image should be inscribed into a box.
ButtonSize
ButtonVariant
ChartLegendPosition
Placement for chart legends rendered inside chart bounds.
ChartType
Enumerates the supported chart types.
ClipboardSelection
Clipboard selection targets for OSC 52 operations.
ClipboardSetMethod
Clipboard write transport used by ClipboardSetMsg.
ConfirmDisplayMode
Display mode for the confirm component.
CrossAxisAlignment
CursorMode
Cursor display mode.
DataTableBorderStyle
Border style for DataTable.
DebugOverlayPosition
Position options for the debug overlay.
DecorationPosition
Where to paint a decoration relative to the child.
DiffLineType
The type of a parsed diff line.
DiffViewMode
The display mode for the diff viewer.
EchoMode
Echo mode for text input display.
FilterState
Filter state for the list.
FlexFit
GestureDisposition
The final disposition of a recognizer in the arena.
GestureRecognizerState
The lifecycle state of a gesture recognizer.
HitTestBehavior
Controls how a widget behaves during hit testing.
KeyType
Types of keyboard input events.
ListTileControlAffinity
Position of the control in list-tile-style rows.
MainAxisAlignment
MainAxisSize
MetricTrend
Trend direction for a MetricDisplay.
MouseAction
Mouse event action types.
MouseButton
Mouse button identifiers.
MouseMode
Mouse tracking modes for the terminal.
Overflow
PaginationType
Pagination rendering type.
PanelAlignment
Alignment for panel content.
PasswordEchoMode
Echo mode for password display.
ProgressLabelPosition
Where to display the percentage label relative to the bar.
ProgressStyle
Predefined fill/track character sets for ProgressIndicator.
RenderCrossAxisAlignment
Alignment policy along the cross axis for flex layouts.
RenderFlexFit
Fit behavior for flex children.
RenderMainAxisAlignment
Horizontal/vertical alignment policy along the main axis for flex layouts.
RenderMainAxisSize
How much space a flex layout should consume on its main axis.
ReplayEventControl
Replay control decision for a custom replay event.
SidebarSide
StackFit
StepStatus
Status of a single step in a StepIndicator.
StyledBlockDisplayStyle
Display style for styled blocks.
TableAlign
Column alignment options for tables.
TaskStatus
Task status values.
TerminalProgressBarState
TerminalProgressBarState represents the state of the terminal taskbar progress.
TextAlign
TextOverflow
TooltipPosition
TraceTag
Trace categories for filtering and grouping trace output.
WrapAlignment
WrapCrossAlignment

Mixins

AnimationMixin<T extends StatefulWidget>
Mixin for State classes that host one or more AnimationControllers.
ComponentHost
A mixin for Models that host one or more ViewComponents.
CopyWithModel
Mixin that documents the copyWith pattern for models.
FocusableWidget
Mixin for widgets that need to track focus state.
TerminalThemeHost
Mixin for models/components that want terminal theme state with minimal boilerplate.

Extensions

AlertFactory on Alert
Factory methods for common alert styles.
BoxPresets on BoxBuilder
Factory methods for common box styles.
CmdExtension on Cmd?
Extension methods for nullable Cmd.
DefinitionListFactory on DefinitionList
Factory methods for common definition list styles.
KeyMatchExtension on Key
Extension to check key matches more fluently.
KeyMsgMatchExtension on KeyMsg
Extension to check KeyMsg matches.
PanelPresets on Panel
Factory methods for common panel styles.
StyledBlockFactory on StyledBlock
Factory methods for common styled block styles.
TableFactory on Table
Factory methods for common table styles.
ThemeContext on BuildContext
Convenience accessors for theme lookup on BuildContext.
TreeFactory on Tree
Factory methods for common tree styles.
TuiTerminalRendererExtension on TuiTerminal
Extension to create renderers from terminals.
TwoColumnDetailFactory on TwoColumnDetail
Factory methods for common two-column detail styles.

Constants

defaultEmptyCharBlock → const String
Default character used to fill the empty portion of the progress bar.
defaultFullCharFullBlock → const String
Default character used to fill the progress bar (full block).
defaultFullCharHalfBlock → const String
Default character used to fill the progress bar. It is a half block, which allows more granular color blending control.
gravity → const Vector
Gravity helpers (match harmonica names).
promptProgramOptions → const ProgramOptions
Shared defaults for "artisanal-style" prompts that run a single bubble and return a value.
terminalGravity → const Vector
textareaPromptOptions → const ProgramOptions
Dedicated defaults for full-screen text editing prompts.
undefined → const Object
Sentinel value to distinguish "not provided" from "explicitly set to null" in ViewportModel.copyWith. This allows callers to set nullable fields to null (e.g., copyWith(selectionStart: null)) rather than keeping the existing value (the default when the parameter is omitted).

Properties

currentTheme Theme
Returns the current global theme.
no setter
globalZone ZoneManager?
Returns the global zone manager if initialized.
no setter
hasDarkBackground bool
Whether the terminal has a dark background.
no setter
hasGlobalZone bool
Whether the global zone manager has been initialized.
no setter
isSharedStdinStreamStarted bool
Returns true if the shared stdin stream has started listening to stdin.
no setter
sharedStdinStream Stream<List<int>>
Shared broadcast stream for stdin to allow multiple listeners and restarts.
no setter
zone ZoneManager
Gets the global zone manager.
no setter

Functions

closeGlobalZone() → void
Closes the global zone manager.
compressAnsi(String input) String
Removes redundant SGR sequences to reduce output size.
createElement(Widget widget) Element
Creates an element for a widget.
createSanitizer([SanitizerOptions? options]) RuneSanitizer
Creates a rune sanitizer with the given options.
defaultFilter(String term, List<String> targets) List<Rank>
Default fuzzy filter implementation.
defaultSearchFilter<T>(String query, List<T> items, String toString(T)) List<FilteredSearchItem<T>>
Default fuzzy filter implementation.
defaultTextAreaStyles() TextAreaStyles
defaultTextInputStyles({bool isDark = true}) TextInputStyles
Returns the default styles for the text input.
elementOf(Widget widget) Element?
Returns the mounted Element associated with widget, if any.
every(Duration interval, Msg? callback(DateTime time), {Object? id}) Cmd
Helper to create a repeating timer command.
firstGraphemeCluster(String s) → ({String first, String rest})
Gets the first grapheme cluster from a string.
fpsDelta(int n) double
Returns the time delta for a given frames-per-second value.
highlightCodeString(String code, {String? language, ChromaTheme? theme}) String
Highlights code and returns ANSI-styled output.
initGlobalZone() ZoneManager
Initializes the global zone manager.
keyMatches(Key key, List<KeyBinding> bindings) bool
Checks if a key message matches any of the given bindings.
keyMatchesSingle(Key key, KeyBinding binding) bool
Checks if a key matches a single binding.
keyToIdOrFallback(Key? key, Object fallback) String
Returns a stable string ID for a possibly-null key.
markdownToAnsi(String markdown, {AnsiRendererOptions? options}) String
Converts a markdown string to ANSI-styled terminal text.
mathMax(int a, int b) int
newSpringFromFps(int fps, double frequency, double damping) Spring
Convenience to create a spring using FPS like the Go API.
noCmd(Model model) UpdateResult
Helper function to create an update result with no command.
progressIterateCmd<T>({required int id, required Iterable<T> items, required Future<void> onItem(T item)}) StreamCmd<Msg>
Produces a UV-safe StreamCmd that runs onItem for each element and emits progress updates for a hosted ProgressBarModel.
quit(Model model) UpdateResult
Helper function to create an update result that quits.
replayScenarioStream(List<ReplayAction> actions, {required bool loop, required bool keepOpen, required double speed, ReplayEventHook? eventHook}) Stream<Msg>
Builds a replay message stream from a list of replay actions.
runAnticipatePrompt(AnticipateModel model, Terminal terminal, {ProgramOptions? options}) Future<String?>
Runs an AnticipateModel and resolves to the accepted value, or null if cancelled.
runConfirmPrompt(ConfirmModel model, Terminal terminal, {ProgramOptions? options}) Future<bool?>
Runs a ConfirmModel and resolves to the selected value, or null if cancelled.
runeWidth(int rune) int
Calculates the display width of a single rune.
runMultiSelectPrompt<T>(MultiSelectModel<T> model, Terminal terminal, {ProgramOptions? options}) Future<List<T>?>
Runs a MultiSelectModel and resolves to the selected items, or null if cancelled.
runPasswordConfirmPrompt(PasswordConfirmModel model, Terminal terminal, {ProgramOptions? options}) Future<String?>
Runs a PasswordConfirmModel and resolves to the submitted password, or null if cancelled.
runPasswordPrompt(PasswordModel model, Terminal terminal, {ProgramOptions? options}) Future<String?>
Runs a PasswordModel and resolves to the submitted password, or null if cancelled.
runProgram<M extends Model>(M model, {ProgramOptions options = const ProgramOptions()}) Future<void>
Runs a TUI program with the given model.
runProgramDebug<M extends Model>(M model, {ProgramOptions? options}) Future<void>
Runs a TUI program without panic catching (for debugging).
runProgramWithResult<M extends Model>(M model, {ProgramOptions options = const ProgramOptions()}) Future<M>
Runs a TUI program and returns the final model after exit.
runSearchPrompt<T>(SearchModel<T> model, Terminal terminal, {ProgramOptions? options}) Future<T?>
Runs a SearchModel and resolves to the selected item, or null if cancelled.
runSelectPrompt<T>(SelectModel<T> model, Terminal terminal, {ProgramOptions? options}) Future<T?>
Runs a SelectModel and resolves to the selected item, or null if cancelled.
runSpinnerTask<T>({required String message, required Future<T> task(), Spinner spinner = Spinners.miniDot, required Terminal terminal, ProgramOptions? options}) Future<T>
Runs an animated spinner while executing task, returning its result.
runTextAreaPrompt(TextAreaModel model, Terminal terminal, {ProgramOptions? options}) Future<String?>
Runs a TextAreaModel and resolves to the submitted value, or null if cancelled.
runTextInputPrompt(TextInputModel model, Terminal terminal, {ProgramOptions? options}) Future<String?>
Runs a TextInputModel and resolves to the submitted value, or null if cancelled.
runWizardPrompt(WizardModel model, Terminal terminal, {ProgramOptions? options}) Future<Map<String, dynamic>?>
Runs a WizardModel and resolves to the final answers, or null if cancelled.
setHasDarkBackground(bool value) → void
Updates the dark background state.
setTheme(Theme theme) → void
Sets the global theme.
shortHash(Object? object) String
Short 5-hex hash for diagnostics.
shutdownSharedStdinStream() Future<void>
Shuts down the shared stdin stream so the process can exit cleanly.
stringWidth(String s) int
Calculates the display width of a string, accounting for wide characters.
truncate(String s, int width, [String tail = '']) String
Truncates a string to fit within the given width.
updateThemeFromBackground(String? hex) → void
Updates theme based on background hex color (e.g., '#1a1a1a').

Typedefs

AlertStyleFunc = Style? Function(String line, int lineIndex)
Callback for alert message styling.
AnimationStatusListener = void Function(AnimationStatus status)
Signature for callbacks that receive AnimationStatus changes.
AsyncWidgetBuilder<T> = Widget Function(BuildContext context, AsyncSnapshot<T> snapshot)
BoxContentStyleFunc = Style? Function(String line, int lineIndex)
Callback for box content styling.
CmdCallback = Cmd? Function()
CmdFunc = Cmd Function()
Type alias for a function that creates commands.
CmdFunc1<T> = Cmd Function(T value)
Type alias for a function that creates commands from a value.
ColorFunc = Color Function(double total, double current)
Function that can be used to dynamically fill the progress bar. total is the total filled percentage, and current is the current percentage that is actively being filled with a color.
DefinitionStyleFunc = Style? Function(String term, String description, int index, bool isTerm)
Callback for styling definition list items.
FilterFunc = List<Rank> Function(String term, List<String> targets)
Filter function type.
FocusChangedCallback = void Function(bool focused)
FocusKeyCallback = Cmd? Function(KeyMsg msg)
FocusListener = void Function()
GestureDoubleTapCallback = Cmd? Function()
Callback for double-tap events.
GestureDragEndCallback = Cmd? Function(DragEndDetails details)
Callback for the end of a drag gesture.
GestureDragStartCallback = Cmd? Function(DragStartDetails details)
Callback for the start of a drag gesture.
GestureDragUpdateCallback = Cmd? Function(DragUpdateDetails details)
Callback for drag update events.
GestureLongPressCallback = Cmd? Function()
Callback for long-press events.
GestureLongPressEndCallback = Cmd? Function(LongPressEndDetails details)
Callback for the end of a long-press gesture.
GestureLongPressStartCallback = Cmd? Function(LongPressStartDetails details)
Callback for the start of a long-press gesture.
GestureTapCallback = Cmd? Function()
Callback for simple tap events (press + release within slop).
GestureTapCancelCallback = Cmd? Function()
Callback for tap cancellation (pointer moved beyond slop).
GestureTapDownCallback = Cmd? Function(TapDownDetails details)
Callback for tap-down events with position and modifier details.
GestureTapUpCallback = Cmd? Function(TapUpDetails details)
Callback for tap-up events with position details.
GestureWheelCallback = Cmd? Function(MouseMsg msg)
Callback for mouse wheel events (passes through raw MouseMsg).
GutterFunc = String Function(GutterContext context)
GutterFunc can be implemented and set into ViewportModel.leftGutterFunc.
IndexedSeparatorBuilder = Widget Function(BuildContext context, int index)
IndexedWidgetBuilder = Widget Function(BuildContext context, int index)
A scrollable list of child widgets.
ListStyleFunc = Style? Function(int index, String item)
Callback for per-item styling in lists.
MessageFilter = Msg? Function(Model model, Msg msg)
A function that filters messages before they reach the model.
MouseEnterCallback = Cmd? Function(MouseMsg msg)
Callback for mouse enter events.
MouseExitCallback = Cmd? Function(MouseMsg msg)
Callback for mouse exit events.
PanelContentStyleFunc = Style? Function(String line, int lineIndex)
Callback for panel content styling.
PromptFunc = String Function(PromptInfo info)
PromptInfo = ({int col, bool isFocused, int lineIndex, int row})
ReplayEventHook = FutureOr<ReplayEventDirective?> Function(ReplayCustomEvent event)
Hook invoked when replay reaches an event action.
RouteFactory = Route? Function(RouteSettings settings)
A factory function that creates a route from settings.
RouteWidgetBuilder = Widget Function(BuildContext context)
A builder that creates a widget for a route.
RuneSanitizer = List<int> Function(List<int> runes)
Function type for sanitizing rune lists.
SearchFilterFunc<T> = List<FilteredSearchItem<T>> Function(String query, List<T> items, String toString(T))
Filter function type for search.
StyledBlockStyleFunc = Style? Function(String line, int lineIndex)
Callback for block content styling.
TableStyleFunc = Style? Function(int row, int col, String data)
Callback for per-cell styling in tables.
TextChangedCallback = void Function(String value)
Signature for text change notifications from TextField.
TextFieldController = TextEditingController
Alias for TextEditingController for backward compatibility.
TreeEnumeratorFunc = String Function(List<TreeNode> children, int index)
TreeEnumeratorStyleFunc = Style? Function(List children, int index)
Callback for per-item enumerator (branch character) styling in trees.
TreeIndenterFunc = String Function(List<TreeNode> children, int index)
TreeNodeStyleFunc = Style Function(List<TreeNode> children, int index)
TreeStyleFunc = Style? Function(String item, int depth, bool isDirectory)
Callback for per-item styling in trees.
TuiTerminal = Terminal
Alias for backward compatibility.
TweenConstructor = Tween Function(dynamic value)
Callback type for constructing a new Tween from a target value.
TweenVisitor = Tween? Function(Tween? tween, dynamic targetValue, TweenConstructor constructor)
Callback type for visiting tweens in AnimatedWidgetBaseState.forEachTween.
TwoColumnStyleFunc = Style? Function(String text, bool isLeft)
Callback for styling the left or right column.
UpdateResult = (Model, Cmd?)
Type alias for the update function return type.
ValueCmdCallback<T> = Cmd? Function(T value)
VoidCallback = void Function()
WidgetFrameTimingCallback = void Function(WidgetFrameTiming timing)
Callback for per-frame widget-level timing data.

Exceptions / Errors

FlutterError
Simple error class for widget framework errors.
ProgramCancelledError
Error thrown when a program is cancelled via an external signal.