hasty library

Functions

a({required String href, required String content, String? classes, String? target, Style? style}) Node
An anchor link.
article({String? id, String? classes, List<Node>? children, Style? style}) Node
A generic article container.
br() Node
A line break.
button(String label, {String? type, String? classes, Style? style}) Node
A button.
caption(String content, {String? classes, Style? style}) Node
A table caption (rendered above the table).
center({required Node child, Style? style}) Node
Centers a child both horizontally and vertically using flexbox.
col({int? span, String? classes, Style? style}) Node
A single column definition inside a colgroup (void element).
colgroup({String? classes, Style? style, List<Node>? children}) Node
A group of columns — lets you apply styles to whole columns at once.
div({String? id, String? classes, List<Node>? children, Style? style}) Node
A generic container.
em(String content, {Style? style, String? classes}) Node
Italic text.
emit(Node root, {String outputDir = 'build', String fileName = 'index', String title = '', String lang = 'en'}) Future<void>
Emits the generated code from root.
fieldset({String? id, String? classes, Style? style, List<Node>? children, bool disabled = false}) Node
A labelled group of form controls.
A page footer.
form({String? action, String? method, String? id, String? classes, Style? style, List<Node>? children}) Node
A form container.
h1(String content, {Style? style, String? classes}) Node
h2(String content, {Style? style, String? classes}) Node
h3(String content, {Style? style, String? classes}) Node
h4(String content, {Style? style, String? classes}) Node
h5(String content, {Style? style, String? classes}) Node
h6(String content, {Style? style, String? classes}) Node
A page header.
hr({Style? style}) Node
A horizontal rule (divider).
hStack({List<Node>? children, Style? style, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, String? id, String? classes}) Node
Horizontal stack of children — maps to a row flexbox div.
img({required String src, String? alt, String? classes, Style? style}) Node
An image.
input({String type = 'text', String? name, String? id, String? value, String? placeholder, String? min, String? max, String? step, String? pattern, String? accept, String? classes, Style? style, bool required = false, bool disabled = false, bool readonly = false, bool checked = false}) Node
A form input (void element — no children).
label({String? htmlFor, String? content, String? classes, Style? style, List<Node>? children}) Node
A form label. Use htmlFor to associate it with an input's id. Supply either content for plain text or children for richer markup.
legend(String content, {String? classes, Style? style}) Node
A caption for a fieldset.
li(String content, {Style? style, String? classes}) Node
A list item.
main_({String? id, String? classes, List<Node>? children, Style? style}) Node
The main content area.
A navigation container.
ol({List<Node>? children, String? classes, Style? style}) Node
An ordered list.
optgroup({required String label, List<Node>? children, bool disabled = false}) Node
A grouped set of options inside a select.
option({required String value, required String content, bool selected = false, bool disabled = false}) Node
An option inside a select.
p(String content, {Style? style, String? classes}) Node
A paragraph.
padding({required Node child, double? all, double? horizontal, double? vertical, double? top, double? right, double? bottom, double? left}) Node
Wraps a single child with padding.
raw(String html) Node
Injects html as-is without any escaping. UNSAFE — only use this with content you fully control. Never pass user-supplied data to this function.
renderHtml(Node root) String
Returns the raw HTML string for root without writing any files.
section({String? id, String? classes, List<Node>? children, Style? style}) Node
A semantic section.
select({String? name, String? id, String? classes, Style? style, List<Node>? children, bool required = false, bool disabled = false, bool multiple = false}) Node
A dropdown selector.
spacer() Node
Flexible spacer that expands to fill available space in a flex container.
span(String content, {Style? style, String? classes}) Node
An inline span.
strong(String content, {Style? style, String? classes}) Node
Bold text.
table({String? id, String? classes, Style? style, List<Node>? children}) Node
A table.
tbody({String? classes, Style? style, List<Node>? children}) Node
A table body group.
td({String? content, int? colspan, int? rowspan, String? classes, Style? style, List<Node>? children}) Node
A table data cell.
text(String content, {TextKind kind = TextKind.body, Style? style, String? classes}) Node
A text element. Use kind to pick the semantic tag (default: body →
textarea({String? name, String? id, String? placeholder, int? rows, int? cols, String? content, String? classes, Style? style, bool required = false, bool disabled = false, bool readonly = false}) Node
A multi-line text input.
tfoot({String? classes, Style? style, List<Node>? children}) Node
A table footer group.
th({String? content, int? colspan, int? rowspan, Scope? scope, String? classes, Style? style, List<Node>? children}) Node
A table header cell. Use scope to declare what it headers.
thead({String? classes, Style? style, List<Node>? children}) Node
A table header group.
tr({String? classes, Style? style, List<Node>? children}) Node
A table row.
ul({List<Node>? children, String? classes, Style? style}) Node
An unordered list.
vStack({List<Node>? children, Style? style, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.stretch, String? id, String? classes}) Node
Vertical stack of children — maps to a column flexbox div.
zStack({List<Node>? children, Style? style, String? id, String? classes}) Node
Layered stack — children are positioned on top of each other. The container is position:relative; children should use position:absolute.

Exceptions / Errors

ArgParseException