setLeaf method

DeepNavigationNode<T> setLeaf(
  1. DeepNavigationNode<T> newLeaf
)

Creates a copy of this DeepNavigationNode that has newLeaf set as the child of the current leaf.

Implementation

DeepNavigationNode<T> setLeaf(DeepNavigationNode<T> newLeaf) {
  if (child == null) {
    return setChild(newLeaf);
  }
  return createCopy(newChild: child!.setLeaf(newLeaf));
}