ui/dom
library
Functions
-
clearChildren(Element parent)
→ void
-
Removes all children of
parent.
-
div({String? classes, String? text, List<Node> children = const []})
→ HTMLElement
-
A
<div> with optional classes and children.
-
el(String tag, {String? classes, String? text, String? id, String? role, String? ariaLabel, Map<String, String>? attrs, List<Node> children = const [], void onClick(Event event)?})
→ HTMLElement
-
Ergonomic DOM construction over
package:web.
-
mount(Element parent, Node child)
→ void
-
Replaces the entire content of
parent with child.
-
on(EventTarget target, String event, void handler(Event event))
→ void Function()
-
Attaches
handler to event on target, returning a disposer that detaches
it (handy for components that re-render and must avoid listener leaks).
-
textNode(String value)
→ Text
-
A text node, for mixing raw strings into
children lists.