emojiFy method

String emojiFy(
  1. String text
)

Emojify the input text.

For example: 'I :heart: :coffee:' => 'I ❤️ ☕'

Implementation

String emojiFy(String text) {
  Iterable<Match> matches = regexName.allMatches(text);
  if (matches.isNotEmpty) {
    String result = text;
    matches.toList().forEach((m) {
      var group = m.group(0) ?? "";
      var _e = EmojiUtil.stripColons(group);
      if (hasName(_e)) {
        result = result.replaceAll(group, get(_e).code);
      }
    });
    return result;
  }
  return text;
}