fromName static method

AnimatedEmojiData fromName(
  1. String name
)

Return the animated emoji of name.

When no emoji is found a EmojiNotFoundException is thrown.

// Will return a rose emoji 🌹
AnimatedEmojis.fromName('rose')

Implementation

static AnimatedEmojiData fromName(String name) {
  try {
    return AnimatedEmojis.values
        .firstWhere((element) => element.name == name);
  } catch (_) {
    throw EmojiNotFoundException.fromName(name);
  }
}