incremental_dom_bindings library

Properties

applyAttr ValueSetter
A predefined function, that applies a value as an attribute.
no setter
applyProp ValueSetter
A predefined function, that applies a value as a property.
no setter
attributes Attributes
The attributes object allows you to provide a function to decide what to do when an attribute passed to elementOpen or similar functions changes. The following example makes IncrementalDOM always set value as a property.
final
notifications Notifications
You can be notified when Nodes are added or removed by IncrementalDOM by specifying functions for notifications.nodesCreated and notifications.nodesDeleted. If there are added or removed nodes during a patch operation, the appropriate function will be called at the end of the patch with the added or removed nodes.
final

Functions

attr(String name, Object value) → void
Used with elementOpenStart and elementOpenEnd to declare an element.
currentElement() Element
Provides a way to get the currently open element.
currentPointer() Node
The current location in the DOM that Incremental DOM is looking at. This will be the next Node that will be compared against for the next elementOpen or text call.
elementClose(String tagname) Element
Signifies the end of the element opened with elementOpen, corresponding to a closing tag (e.g.
elementOpen(String tagname, [String? key, List<Object>? staticPropertyValuePairs, List<Object>? propertyValuePairs]) Element
Declares an Element with zero or more attributes/properties that should be present at the current location in the document tree.
elementOpenEnd() Element
Used with elementOpenStart and attr to declare an element.
elementOpenStart(String tagname, [String? key, List<Object>? staticPropertyValuePairs]) → void
Used with attr and elementOpenEnd to declare an element.
elementVoid(String tagname, [String? key, List<Object>? staticPropertyValuePairs, List<Object>? propertyValuePairs]) Element
A combination of elementOpen, followed by elementClose.
patch(Node node, void description(Object?), [Object? data]) → void
Updates the provided Node with a function containing zero or more calls to elementOpen, text and elementClose. The provided callback function may call other such functions. The patch function may be called with a new Node while a call to patch is already executing.
skip() → void
Moves the current pointer to the end of the currently open element. This prevents Incremental DOM from removing any children of the currently open element. When calling skip, there should be no calls to elementOpen (or similiar) prior to the elementClose call for the currently open element.
skipNode() → void
Moves the current patch pointer forward by one node. This can be used to skip over elements declared outside of Incremental DOM.
text(Object value, {List<String Function(Object)>? formatters}) Text
Declares a Text node, with the specified text, should appear at the current location in the document tree.

Typedefs

NodeListener = void Function(List<Node> nodes)
A listener for node events.
ValueSetter = void Function(Element element, String name, Object? value)
A function to set a value as a property or attribute for an element.