splitAt method
Splits this EasyText at specified offset
asDirtytells to this method to mark the splitted node part as dirty before inserting again into theEasTextListparent
Returns the inserted EasyText object
Implementation
EasyText? splitAt(int index, [bool asDirty = false]) {
assert(
index >= 0 && index <= length,
'offset $index does '
'not satisfy the range '
'of this text => 0 to $length');
if (index == 0) return this;
if (index == length) return isLast ? null : next;
final EasyText split = EasyText(
text: after(index),
styles: styles.copy(),
);
text = before(index);
if (asDirty) {
split._dirty = true;
}
insertAfter(split);
return split;
}