findEmojiText method

EySpecialText? findEmojiText(
  1. String? data,
  2. String? textStack,
  3. int? index,
  4. TextStyle? textStyle,
)

Implementation

EySpecialText? findEmojiText(String? data, String? textStack, int? index, TextStyle? textStyle) {
  String sub = data?.substring(index ?? 0 + 1) ?? "";
  var split = sub.split(RegExp(r'(/|]|:)', caseSensitive: false));
  if (split.isEmptyList || split[0].isEmptyString) {
    return null;
  }
  var text = split[0];
  var specialText = EmojiText(targetText: text, textStyle: textStyle, start: index, emojiSize: emojiSize ?? 20);
  if (textStack.isNotEmptyString) {
    specialText.setStartFlag(textStack![textStack.length - 1]);
  }
  specialText.setTextType(SpecialTextType.emoji);
  specialText.setOffset(1);
  return specialText;
}