moveIntoPrevious method

bool moveIntoPrevious(
  1. TKey key
)

Moves key in as the last child of its previous live sibling. See moveUp.

Implementation

bool moveIntoPrevious(TKey key) {
  final index = treeController.getIndexInParent(key);
  if (index <= 0) {
    return false;
  }
  final parent = treeController.getParent(key);
  final previous = treeController.liveSiblingAt(parent, index - 1);
  if (previous == null) {
    return false;
  }
  return moveTo(
    key,
    previous,
    index: treeController.liveChildCount(previous),
  );
}