find method

T? find(
  1. TreeFun<T> callback
)

在子节点中查找对应节点

Implementation

T? find(TreeFun<T> callback) {
  int index = -1;
  for (T node in _childrenList) {
    if (callback.call(node, ++index, this as T)) {
      return node;
    }
  }
  return null;
}