finishText method

  1. @override
InlineSpan finishText()

finish SpecialText

Implementation

@override
InlineSpan finishText() {
  final String key = toString();

  if (EmojiUtil.instance.emojiMap.containsKey(key)) {
    double size = 18;

    if (textStyle?.fontSize != null) {
      size = textStyle!.fontSize! * 1.15;
    }

    return EmojiSpan(
      Image.asset(
        EmojiUtil.instance.emojiMap[key]!.source,
        package: kPackage,
        height: 16,
        width: 16,
      ),
      actualText: key,
      imageWidth: size,
      imageHeight: size,
      start: start!,
      //fit: BoxFit.fill,
      margin: const EdgeInsets.all(2),
    );
  }

  return TextSpan(text: toString(), style: textStyle);
}