splitAtCharacterIndex method
Splits this span at the given character index
and returns a list of one
or two spans. If index
is zero, or if index
is greater than the
number of characters in this span, a list containing just this span is
returned. If this span was split, a list of two spans is returned,
containing the two new spans.
Implementation
List<InlineSpan> splitAtCharacterIndex(
int index, {
bool ignoreFloatedWidgetSpans = false,
}) =>
this is SplittableMixin<InlineSpan>
? (this as SplittableMixin<InlineSpan>).splitAt(index,
ignoreFloatedWidgetSpans: ignoreFloatedWidgetSpans)
: defaultSplitSpanAtIndex(SplitAtIndex(index),
ignoreFloatedWidgetSpans: ignoreFloatedWidgetSpans,
copyWithTextSpan: (span, text, children) => span.copyWith(
text: text,
children: children,
noText: text == null,
noChildren: children == null));