getSpansFromTexts function
Implementation
TextSpan? getSpansFromTexts(List<String> texts, InlineSpan original) {
TextSpan? span;
if (texts.length > 0 && original is TextSpan) {
String? text;
if (original.text != null) {
text = "${texts.first}";
texts.removeAt(0);
}
List<InlineSpan> children = [];
if (original.children != null) {
original.children!.forEach((child) {
if (getSpansFromTexts(texts, child) != null) {
children.add(getSpansFromTexts(texts, child)!);
}
});
}
span = TextSpan(
text: text,
children: children,
style: original.style,
recognizer: original.recognizer,
semanticsLabel: original.semanticsLabel
);
}
return span;
}