1.4.0
π¦ Published to pub.dev: dart_tui 1.4.0
Forms (huh-style)
A composable, immutable, key-based forms subsystem β the equivalent of Charm's huh.
Form(forms/form.dart) β an immutableTeaModelyou can embed (exposessubmitted/cancelled/values), or run one-shot withawait form.run()(returnsFormValues?,nullif cancelled). Groups of fields render one page at a time as a wizard, with aGroup N/Mindicator.- Field types via the
Fieldfactory:input,password,text(multiline),file,select/selectOf<T>,multiSelect/multiSelectOf<T>,confirm,note. Text-ish fields reuseTextInputModel/TextAreaModel/FilePickerModel. - Key-based values β
FormValues.get<T>(key); hidden fields are excluded from the result. - Validation β per-field
validatewith inline errors; blocks advancing and submit. - Dynamic / conditional fields β any field or group takes
hidden: (FormValues) => bool; titles and select options can be computed from other fields' values (titleFor,optionsFor), recomputed on every change with selection clamping. - Navigation β
Tab/Enteradvance (Enter inserts a newline in multilinetext;Tab/Ctrl+Dadvance there),Shift+Tabback,Esc/Ctrl+Ccancel. FormStylesβ Catppuccin Mocha defaults.- New
form.dartexample + VHS tape.
Fixes
TextInputModel/TextAreaModel: typing a space inserted the literal string"space"(and F-keys inserted"f1", etc.) because the default branch inserted the keystroke name rather than the character. Now only unmodified printable runes are inserted, using the actual rune text β so text fields (and form inputs) accept spaces correctly.
Docs
- New documentation website β a searchable gallery of every component, block and guide with live GIF previews and copyable source. Lives in
website/(excluded from the published package via.pubignore).