shift method
Shift spans with an insertion at index
with the given length
.
Implementation
SpanList shift(int index, int length) {
if (index < 0) {
throw ArgumentError.value(index, 'index', 'Index must be non-negative.');
}
if (length == 0) {
return this;
}
return SpanList(_spans.map((s) => s.shift(index, length)));
}