emojiFinder function

bool emojiFinder(
  1. String text, {
  2. bool isEmojiFirst = false,
})

If isFirst = true, emojiFinder() will return true when the first of your input text is emoji.

Implementation

bool emojiFinder(
  String text, {
  bool isEmojiFirst = false,
}) {
  String trimed = text.trim();
  bool useEmoji = trimed.contains(_f);

  if (!isEmojiFirst) return useEmoji;

  if (trimed.isEmpty) return false;

  return _f.hasMatch(trimed[0]);
}