findColorText method
Implementation
EySpecialText? findColorText(
String? data, String? textStack, int? index, TextStyle? textStyle, SpecialTextGestureTapCallback? onTap) {
String sub = data?.substring(index ?? 0 + 1) ?? "";
var split = sub.split(ColorText.colorTag);
if (split.isEmptyList || split[0].isEmptyString) {
return null;
}
var text = split[0];
var colorText =
ColorText(targetText: text, extrasMap: extrasMap, start: index, textStyle: textStyle, tapCallback: onTap);
colorText.setStartFlag(ColorText.colorTag);
colorText.setTextType(SpecialTextType.color);
colorText.setOffset(ColorText.colorTag.length);
return colorText;
}