removeLine method

void removeLine({
  1. required BigInt lineIdx,
})

Implementation

void removeLine({required BigInt lineIdx}) {
  if (_root.summary.lines == 0) return;
  _root.remove(lineIdx.toInt().clamp(0, _root.summary.lines - 1));
  if (_root is _LayoutInternal &&
      (_root as _LayoutInternal).children.isEmpty) {
    _root = _LayoutLeaf();
  }
  while (_root is _LayoutInternal &&
      (_root as _LayoutInternal).children.length == 1) {
    _root = (_root as _LayoutInternal).children.single;
  }
}