cutAt method

LeafNode cutAt(
  1. int index
)

Cuts a leaf node from index to the end of this node and returns new node in detached state (e.g. mounted returns false).

Splitting logic is identical to one described in splitAt, meaning this method may return null.

Implementation

LeafNode cutAt(int index) {
  assert(index >= 0 && index <= length);
  final cut = splitAt(index);
  cut?.unlink();
  return cut;
}