fromId static method

AnimatedEmojiData fromId(
  1. String id
)

Return the animated emoji that equals id.

When no emoji is found a EmojiNotFoundException is thrown.

// Will return a firework emoji 🎆
AnimatedEmojis.fromId('u1f386')

Implementation

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