insert method

  1. @override
void insert(
  1. int index,
  2. Object data,
  3. Style? style
)
override

Implementation

@override
void insert(int index, Object data, Style? style) {
  final length = this.length;
  assert(index >= 0 && index <= length);
  final node = Leaf(data);
  if (index < length) {
    splitAt(index)!.insertBefore(node);
  } else {
    insertAfter(node);
  }
  node.format(style);
}