buildNodes method

List<T> buildNodes(
  1. DOMElement? domParent,
  2. T? parent,
  3. List<DOMNode>? domNodes,
  4. DOMTreeMap<T> treeMap,
  5. DOMContext<T>? context,
)

Implementation

List<T> buildNodes(DOMElement? domParent, T? parent, List<DOMNode>? domNodes,
    DOMTreeMap<T> treeMap, DOMContext<T>? context) {
  if (domNodes == null || domNodes.isEmpty) return [];

  var elements = <T>[];

  for (var node in domNodes) {
    var element = build(domParent, parent, node, treeMap, context);
    if (element != null) {
      elements.add(element);
    }
  }

  return elements;
}