hasOnlyEmojis static method

bool hasOnlyEmojis(
  1. String text, {
  2. bool ignoreWhitespace = false,
})

Returns true if text contains only emoji icon.

Implementation

static bool hasOnlyEmojis(String text, {bool ignoreWhitespace = false}) {
  if (ignoreWhitespace) text = text.replaceAll(' ', '');
  for (final c in Characters(text)) if (!regexEmoji.hasMatch(c)) return false;
  return true;
}