NodeBuilder class

Helper class to build nodes.

Constructors

NodeBuilder(String tagName, {Map<String, dynamic> attributes = const {}, Iterable<Node> children = const []})
NodeBuilder.existing(Node existingNode)
Creates a NodeBuilder that just spits out an already-existing Node.
factory
NodeBuilder.from(Node node)
factory

Properties

attributes Map<String, dynamic>
final
children Iterable<Node>
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tagName String
final

Methods

addChild(Node child) NodeBuilder
addClass(String className) NodeBuilder
build({bool selfClosing = false}) Node
Builds the node.
change({String? tagName, Map<String, dynamic>? attributes, Iterable<Node>? children}) NodeBuilder
Produce a modified copy of this builder.
changeAttributes(Map<String, dynamic> attributes) NodeBuilder
changeAttributesMapped(Map<String, dynamic> f(Map<String, dynamic>)) NodeBuilder
changeChildren(Iterable<Node> children) NodeBuilder
changeChildrenMapped(Iterable<Node> f(List<Node>)) NodeBuilder
changeTagName(String tagName) NodeBuilder
mapAttributes(MapEntry<String, dynamic> f(String, dynamic)) NodeBuilder
mapChildren(Node f(Node)) NodeBuilder
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAttribute(String name) NodeBuilder
removeChild(Node child) NodeBuilder
removeClass(String className) NodeBuilder
setAttribute(String name, dynamic value) NodeBuilder
setClasses(Iterable<String> classes) NodeBuilder
setClassesMapped(Iterable<String> f(List<String>)) NodeBuilder
setClassName(String className) NodeBuilder
setId(String id) NodeBuilder
toggleClass(String className) NodeBuilder
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited