findColorText method

EySpecialText? findColorText(
  1. String? data,
  2. String? textStack,
  3. int? index,
  4. TextStyle? textStyle,
  5. SpecialTextGestureTapCallback? onTap,
)

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;
}