insert method

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

Implementation

@override
void insert(int index, Object data, Style? style) {
  assert(index == 0 || (index > 0 && index < length));

  if (isNotEmpty) {
    final child = queryChild(index, false);
    if (child.isNotEmpty) {
      child.node!.insert(child.offset, data, style);
    }
  } else {
    assert(index == 0);
    final node = defaultChild;
    add(node);
    node?.insert(index, data, style);
  }
}