tui library

Commander TUI — declarative terminal user interface framework.

Classes

Align
Alignment
AlternateScreenMode
Async<T>
AsyncRegistry
AsyncResolvedEvent
AsyncResult<T, E>
AsyncStream<T>
BarChart
BarDatum
Block
BorderChars
BorderTheme
Buffer
Button
Center
Chain
ChainFlowContext
ChainFlowState
Checkbox
CheckboxGroup<T>
CheckboxGroupState<T>
CheckboxItemState
CodeBlock
CodeBlockState
Holds vertical scroll position for a CodeBlock in scrollable mode. Lives on the caller's state so scroll is preserved across rebuilds.
CodeTheme
Color
Represents a color that can be used in ANSI escape codes, i.e. SetStyles.
Color24
A 24-bit RGB color.
Color8
An extended color palette that includes the base 16 colors and 240 more.
ColorReset
A sentinel value that resets the current color to the terminal's default.
ColorScheme
Column
CommanderLogger
CompositeKey
Composite key built from a list of primitive parts.
Confirm
A single-line y/n prompt. Pressing y / n (case-insensitive) submits the corresponding boolean; pressing Enter submits defaultValue.
Constraint
Container
CustomEvent
DatePicker
DatePickerState
Divider
Each<T>
EdgeInsets
Err<T, E>
Event
Events
Expanded
FileLogger
FillConstraint
Fixed
Flexible
FlowMode
Focusable
FocusableWidget
FocusController
FullScreenMode
Gauge
HitZoneSink
InlineMode
Input
InputNumber
InputNumberState
InputState
Key
KeyEvent
Layout
LegacyTable
LegacyTableState
LengthConstraint
ListState
ListView<T>
MaxConstraint
MinConstraint
MouseEvent
Ok<T, E>
Padding
Paragraph
PercentageConstraint
Positioned
ProgressBar
RadioGroup<T>
RadioOption<T>
Range
RangeState
RatioConstraint
Rect
RenderContext
RenderMode
ResizeEvent
Result<T, E>
Row
RunHandle
Screen
ScrollView
Scrollable container.
ScrollViewState
Select<T>
SelectItemState
SelectState<T>
SilentLogger
Size
SizedWidget
Optional interface for widgets that know their intrinsic height. Used by Chain (and similar layout widgets) to size each step automatically.
Slider
SliderState
Spacer
Sparkline
Single-row line chart using Unicode block characters.
Spinner
Stack
StderrLogger
Style
Switch
SymbolKey
Table<T>
TableCellState
TableColumn<T>
TableConstraint
TableState<T>
Tabs
Terminal
TestTerminal
Text
TextArea
TextAreaState
TextField
TextFieldState
TextTheme
ThemeData
TickEvent
TimePicker
TimePickerState
Tree<T>
TreeNode<T>
TreeState<T>
TuiNavigator<R>
ValueKey
Widget

Enums

AsyncStatus
BarOrientation
BorderSides
BorderStyle
CodeLanguage
Color4
The base 16 (4-bit) colors available on almost all terminals.
ColorMode
Terminal color capability tier, used by AnsiEncoder to decide whether to emit truecolor / 256-color / 16-color escape sequences (or none).
Direction
DividerOrientation
MouseAction
MouseButton
NamedKey
RangeHandle
SelectionMode
TextAlign
TimeField
TitleAlign
Wrap

Extensions

BufferAnsi on Buffer

Functions

charWidth(int codePoint) int
renderToBuffer(Widget widget, {Size size = const Size(80, 24), ThemeData? theme}) Buffer
runTerminal<S>({required S initialState, required OnEventFn<S> onEvent, required RenderFn<S> render, ThemeData? theme, ThemeBuilder<S>? themeBuilder, RenderMode mode = const RenderMode.flow(), List<Stream<Event>> sources = const [], Duration? frameRate, Terminal? terminal, CommanderLogger logger = const SilentLogger(), ColorMode? colorMode, bool allowNonInteractive = false, bool enableMouse = true, bool exitOnCtrlC = true, Duration cursorQueryTimeout = const Duration(milliseconds: 500)}) Future<void>

Typedefs

CellCoord = ({int col, int row})
ChainFlowFn = Future<void> Function(ChainFlowContext ctx)
CheckboxItemBuilder<T> = Widget Function(T item, CheckboxItemState state)
KeyPress = KeyEvent
OnEventFn<S> = FutureOr<void> Function(S state, Event event, RunHandle handle)
RenderFn<S> = void Function(RenderContext ctx, S state)
ScreenBuilder = Widget Function(RenderContext ctx, void exit())
SelectFilter<T> = bool Function(T item, String query)
SelectItemBuilder<T> = Widget Function(T item, SelectItemState state)
TableCellBuilder<T> = Widget Function(T item, TableCellState state)
ThemeBuilder<S> = ThemeData Function(S state)
ValueChanged<T> = void Function(T value)
VoidCallback = void Function()
WidgetBuilder = Widget Function(bool isFocused)