ui/ui library

Classes

Align
A widget that aligns its child within itself.
AlignElement
An element that manages an Align widget.
Alignment
Represents a relative alignment in 2D space.
Animatable
An interface for widgets that support animation ticks or time-based rendering.
AnimatedButton
A button widget featuring multiple layered custom animation effects.
AnimatedButtonState
The mutable state for AnimatedButton, mixing in the TUI animation ticker capability.
Border
Represents the character set and style configuration used to draw a box border.
BoxConstraints
Immutable box layout constraints.
BoxDecoration
Defines the visual decoration style (background and borders) for a box.
Buffer
A 2D grid of Cells representing a draw buffer.
BuildContext
A handle to a location in the widget tree.
Button
An interactive TUI button widget that triggers a callback when activated.
Canvas
A 2D canvas widget for drawing high-resolution pixel graphics in a terminal.
Cell
A single cell in the terminal buffer.
Center
A widget that centers its child within itself.
CharmColors
The official CharmTone color palette from the Charm/Bubble Tea ecosystem.
Checkbox
An interactive checkbox widget for toggling boolean flags.
Color
Represents a 24-bit RGB color with 8-bit alpha, packed into a single 32-bit integer. Using a single final int field minimizes memory footprint for each Color instance.
Colors
Common standard colors.
Column
A layout widget that arranges its children vertically.
ColumnElement
An element that manages a Column widget.
Compositor
Composites multiple layered buffers onto a single target buffer.
ConfirmFormField
A boolean yes/no confirmation prompt field.
ConstrainedBox
A widget that imposes BoxConstraints on its child.
ConstrainedBoxElement
An element that manages a ConstrainedBox widget.
Constraint
Abstract base class for all layout constraints.
DecoratedBox
A widget that paints a background decoration and border around a child widget.
DecoratedBoxElement
Element for DecoratedBox.
DiscreteScrollController
A controller for discrete cell-based scroll positions in TUI layouts.
An interactive select menu button that opens a dropdown list overlay.
State for a DropdownButton.
An item in a DropdownButton menu.
Easing
A collection of standard easing functions matching easings.net.
EdgeInsets
An immutable set of offsets in each of the four cardinal directions in terminal space.
Element
Instantiated element in the widget tree that keeps track of widget updates and state.
ElementWidget
A bridge widget that maintains a persistent Element tree for its child.
Expanded
An Expanded widget forces its child to consume all remaining space in a Row or Column.
FlashEffect
A full-widget background flash pulsation.
FlatNode<T>
Helper info for rendering a flattened tree node.
FlexConstraint
A proportional flexible space constraint.
Flexible
Controls how a child widget of a Row or Column scales.
FlexibleElement
An element that manages a Flexible widget.
Focus
A widget that manages a FocusNode to allow keyboard focus tracking and traversal in the widget tree.
Focusable
An interface that indicates a widget or state can receive keyboard focus.
FocusState
The state for a Focus widget.
Form
A container widget that coordinates focus, validation, and resets for multiple FormField widgets.
FormField<T>
Abstract base class for all form field widgets in termui.
FormFieldState<T>
Abstract state management class for FormField elements.
FormScope
Ancestor provider to expose form state to field elements.
FormState
The mutable state of a Form.
GlobalKey<T extends State<StatefulWidget>>
A key that is unique across the entire element tree. Global keys allow widgets to be uniquely identified and retrieved from the registry.
Grid
A widget that renders a static 2D grid of customized Cells.
Help
A widget that formats and displays keybindings, auto-wrapping them to fit.
HorizontalRadioGroup
A horizontal group of radio-like choices.
HorizontalRadioGroupState
The state class for HorizontalRadioGroup managing selections and keyboard routing.
InheritedElement
An element that manages an InheritedWidget.
InheritedWidget
A widget that propagates information down the tree.
InkwellButton
A button widget with hover elevation (floating shadow) and pressed radial gradient inkwell ripple animation.
InkwellButtonState
The state for an InkwellButton.
InkwellRippleEffect
A radial expanding ripple effect that radiates from a click coordinate.
Interactive
Represents an interactive UI element.
Key
A unique identifier for Widget configurations.
KeyEventHandler
An interface that indicates a widget or state can handle terminal keyboard events.
LayeredBuffer
A buffer positioned in a 2D space with a Z-index for layering.
LazyList
A virtual scrolling list widget. Only renders items within the visible viewport.
LazyTable
A virtual scrolling table widget. Only requests and renders rows within the viewport.
LeafElement
Default element for leaf widgets that do not build children.
LeftBorder
A layout widget that draws a vertical line (left border) on the left side of its child.
LeftBorderElement
The Element corresponding to a LeftBorder widget.
LengthConstraint
A fixed length layout constraint.
LinearProgressIndicator
A progress bar widget that fills its horizontal area with block characters.
ListWidget
A scrollable list of string items.
A specific item within a menu.
MinMaxConstraint
A constraint with min and max bounds.
ModalOverlay
A specialized, high Z-index container that traps focus and intercepts mouse events.
Modifier
Text modifiers represented as a bitmask for performance.
MultiSelectFormField<T>
A form field representing multiple-option selection from a list of choices.
MultiSelectOption<T>
An option in a multi-selection form field.
NumberSelector
A widget for selecting a numeric value using '<' and '>' buttons.
Overlay
A stack-based layout system that manages overlapping floating widgets.
OverlayEntry
An entry representing a widget that can be inserted into an Overlay.
OverlayState
The state for an Overlay, managing its active entries.
Padding
A widget that wraps another widget and inserts padding around it.
PaddingElement
An element that represents a Padding widget.
Paginator
A pagination dots indicator widget (e.g. ○ ○ ● ○ ○).
PercentageConstraint
A percentage-based layout constraint relative to parent size.
PopupMenuButton<T>
A button that displays a pop-up option menu when triggered.
PopupMenuButtonState<T>
State for a PopupMenuButton.
PopupMenuItem<T>
An item in a popup menu.
Positioned
Places a widget inside a Stack at specific coordinate offsets.
PositionedElement
An element that manages a Positioned widget.
PromptRunner<T>
A helper class to run an interactive terminal prompt inline. It encapsulates the event loop, rendering to an inline buffer, and lifecycle management.
PromptScope
An inherited widget that abstracts prompt completion and lifecycle controls, shielding descendant widgets from any low-level/internal event buses.
Radio<T>
An interactive radio button widget to select a single value from a group.
Rect
A 2D rectangle representing bounds in terminal space.
Renderer
A diff-based terminal renderer.
RichText
A widget that displays formatted text using a tree of TextSpan configurations.
Row
A layout widget that arranges its children horizontally.
RowElement
An element that manages a Row widget.
ScrollBar
An interactive scrollbar widget that reflects and adjusts scrolling state.
SelectFormField<T>
A form field representing single-option selection from a list of choices.
SelectionController<T>
A controller that manages selection state for selection-based widgets.
SelectOption<T>
An option in a selection form field.
SevenSegmentDisplay
A widget that displays a multi-line segmented numerical readout.
SingleChildScrollView
A widget that wraps a single child widget and makes it scrollable.
SizedBox
A widget that imposes tight constraints on its child.
SizedBoxElement
An element that manages a SizedBox widget.
Slider
A widget for selecting a numeric value by sliding a thumb along a track.
SparkleEffect
A particle-based sparkle effect that flashes bright icons inside the widget bounds.
Spinner
A widget for displaying animated loading/waiting indicators in a TUI.
SplitPane
A widget that divides a viewport into two side-by-side or stacked children.
Stack
A layout widget that stacks its children on top of each other.
StackElement
An element that manages a Stack widget.
State<T extends StatefulWidget>
The logic and internal state for a StatefulWidget.
StatefulBuilder
A custom stateful builder widget matching standard Flutter patterns. It allows stateful builders to declare their widget layouts dynamically and obtain local access to setState to trigger rebuilds within inline loops.
StatefulElement
An element that manages a StatefulWidget and its State.
StatefulWidget
A widget that has mutable state.
StatelessElement
An element that manages a StatelessWidget.
StatelessWidget
A widget that has configuration but delegates rendering to its built child.
Style
A class representing style attributes for terminal output.
StyledChar
A helper representing a single grapheme cluster with its style.
StyledToken
A helper representing a token (a word, spaces, or a newline) for wrapping.
Switch
An interactive visual switch toggle widget representing true/false state.
TabBar
A horizontal tab bar widget to select active views from a tab set.
TabController
A controller that coordinates the active tab index across TabBar and TabPanel.
Table
A widget for displaying tabular columns of data with optional row selection.
TableElement
Mount element class corresponding to Table, preserving per-cell states.
TabPanel
A container that renders only the widget of the active tab.
Text
A widget that renders styled text with optional wrapping.
TextAreaFormField
A form field wrapping a multi-line text editing area.
TextEditingController
A controller that notifies listeners when editing value changes.
TextEditingValue
Holds the configuration state of a TextField value.
TextField
An interactive single-line or multi-line text input field.
TextFieldShortcut
A keyboard shortcut representation for assigning to TextFieldActions.
TextFieldState
The state for a TextField.
TextFormField
A form field wrapping a single-line text input field.
TextRun
Represents a styled span of text.
TextSelection
Represents the visual cursor selection offset in terminal cells.
TextSpan
An immutable span of text that can hold styling overrides and nested child spans.
Theme
A widget that propagates a ThemeData down the widget tree.
ThemeData
A class that holds the color and style configurations for a Theme.
TimerWidget
An interactive countdown timer widget.
TreeNode<T>
A node in the hierarchical tree structure.
TreeWidget<T>
An interactive, scrollable tree widget that displays hierarchical node trees.
TuiAnimationConfig
Global configuration for the TUI animation framework.
TuiAnimationEffect
Base abstract class for all terminal user interface (TUI) animation effects.
Viewport
A Viewport wraps a parent buffer, translating and clipping drawing operations to a relative local coordinate space within bounds.
Widget
Abstract base class for all renderable widgets.

Enums

AnimationStatus
The status of an animation transition.
CanvasRenderMode
Defines how pixels are grouped and rasterized.
LayoutDirection
Layout direction for box splitting.
PromptExitAction
Defines the state outcome of the PromptRunner when an exit trigger is matched.
PromptExitTrigger
Defines keyboard inputs or signals that can terminate the prompt runner's execution.
RenderingMode
The target mode for terminal rendering.
SliderAxis
The orientation of the slider.
TextAlign
Text alignments for TUI rendering.
TextFieldAction
Actions supported by the TextField widget.

Mixins

TuiAnimatedStateMixin<T extends StatefulWidget>
Mixin for State objects that allows registration and execution of TUI animations.

Extensions

PrintWidgetExtension on Terminal
Extension on term.Terminal to print a widget inline using the double-buffered renderer layout.

Functions

getAbsoluteRect(Buffer buffer, Rect localRect) Rect
Helper function to traverse the parent chain of a Buffer to find its absolute Rect boundaries.
isWideGrapheme(String grapheme) bool
Returns true if the given grapheme cluster is a double-width (wide) character.
measureStringWidth(String text) int
Measures the physical cell width of a string in a terminal, correctly accounting for CJK and Emoji characters that occupy 2 cells.
splitRect(Rect area, List<Constraint> constraints, LayoutDirection direction) List<Rect>
Splits a Rect area into multiple sub-rectangles according to layout constraints.

Typedefs

EasingFunction = double Function(double t)
Signature for easing functions that transform linear progress t in [0, 1] into eased progress.
VoidCallback = void Function()
Signature for callbacks that take no arguments and return no data.
WidgetBuilder = Widget Function(BuildContext context)
A function that builds a widget given a build context.

Exceptions / Errors

PromptAbortedException
Base exception thrown when a PromptRunner is aborted via PromptExitAction.abort.
UserInterruptException
Specialized exception for user keyboard interrupts (typically Ctrl+C).