isChildOf method

  1. @override
bool isChildOf(
  1. Node? parent,
  2. Node? child,
  3. bool deep
)

Returns true if parent has child. If deep is true, will check sub nodes children.

Will call childChecker.

Should be overwritten if childChecker is null.

Implementation

@override
bool isChildOf(Node? parent, Node? child, bool deep) {
  if (parent == null || child == null) return false;

  if (deep) {
    return !identical(parent, child) && parent.contains(child);
  } else {
    return parent.nodes.contains(child);
  }
}