containsNode method

bool containsNode(
  1. DOMNode node, {
  2. dynamic deep = true,
})

Returns true if node is a child of this node.

deep If true looks deeply for node.

Implementation

bool containsNode(DOMNode node, {deep = true}) {
  if (_content == null || _content!.isEmpty) return false;

  for (var child in _content!) {
    if (identical(child, node)) {
      return true;
    }

    if (deep && child.containsNode(node, deep: true)) {
      return true;
    }
  }

  return false;
}