attachRoot method

void attachRoot(
  1. TreeNode<Object?> node, {
  2. bool notify = true,
})

Add a node to the root of this tree

Implementation

void attachRoot(TreeNode node, {bool notify = true}) {
  rootNodes.add(node);
  node._attach(this);

  if (_onAttached != null) _onAttached(node, null);
  if (_onChanged != null) {
    _onChanged();
  }
  if (notify) notifyListeners();
}