insertBefore method

bool insertBefore (
  1. TextBit another
)

Inserts self before another in the text tree.

Implementation

bool insertBefore(TextBit another) {
  if (parent == null) return false;

  assert(parent == another.parent);
  final siblings = parent._children;
  final i = siblings.indexOf(another);
  if (i == -1) return false;

  siblings.insert(i, this);
  return true;
}