A comprehensive Dart package that provides access to a complete collection of emojis with detailed metadata, search capabilities, and regex support.
- 5034+ emojis with detailed metadata
- Emoji regex pattern matching
- Emoji search by keywords
- Group-based emoji filtering
- Full Unicode emoji support
Add this to your package's pubspec.yaml
file:
dependencies:
all_emojis: ^0.1.0
import 'package:all_emojis/all_emojis.dart';
// Get total number of available emojis
print('Total emojis: ${allEmojis.length}'); // 5034 emojis
// Access specific emoji and its metadata
final heartEmoji = allEmojis['❤️']!;
print('Character: ${heartEmoji.char}'); // ❤️
print('Name: ${heartEmoji.name}'); // red heart
print('Keywords: ${heartEmoji.keywords}'); // [heart, love, ...]
print('Group: ${heartEmoji.group}'); // EmojiGroup.smileysAndEmotion
print('Version: ${heartEmoji.emojiVersion}'); // 1.0
// Get all food-related emojis
final foodEmojis = allEmojis.values
.where((emoji) => emoji.keywords.contains('food'))
.map((e) => e.char)
.toList();
// Search for emojis with multiple keywords
final happyEmojis = allEmojis.values
.where((emoji) => emoji.keywords.any((k) =>
k.contains('happy') || k.contains('joy') || k.contains('smile')))
.map((e) => e.char)
.toList();
// Get animal emojis
final animalEmojis = allEmojis.values
.where((emoji) => emoji.group == EmojiGroup.animalsNature)
.map((e) => e.char)
.take(5)
.toList();
// Find all emojis in a text
final text = 'Having lunch 🍕 with friends 👥 is fun! 🎉';
final matches = emojiRegex.allMatches(text);
final foundEmojis = matches.map((m) => m.group(0)).toList();
// Check if a string contains emojis
final hasEmojis = emojiRegex.hasMatch(text); // true
// Get emoji positions in text
final emojiPositions = emojiRegex.allMatches(text)
.map((m) => m.start)
.toList();
Each emoji object contains the following properties:
char
: The emoji charactername
: The official emoji namekeywords
: List of related keywordsslug
: URL-friendly namegroup
: Emoji category groupemojiVersion
: The emoji version
Emojis are categorized into the following groups:
smileysAndEmotion
: 😊 😍 😎peopleAndBody
: 👋 👨👩👧👦 🧑🤝🧑animalsNature
: 🐶 🐱 🐭foodAndDrink
: 🍎 🍕 🍺travelAndPlaces
:✈️ 🏖️ 🏰activities
: ⚽️ 🎮 🎨objects
: 💡 📱 💻symbols
: ❤️ ⭐️ ⚡️flags
: 🏁 🏳️ 🏳️🌈
Contributions are welcome! Please feel free to submit a Pull Request.
This library is generated with the latest available emoji dataset (v15) from Unicode, using a code generator based on https://github.com/alfalcon90/unicode-emoji-dart from https://github.com/alfalcon90. It uses the following libraries to compile the dataset:
emojilib
: provides a list of keywords for every emojiemoji.json
: provides emoji data in JSON formatemoji-regex
: a regular expression to match all emoji symbols and sequences
cd generator
npm install
npm run generate
- Publish it to "pub.dev"
This project is licensed under the MIT License - see the LICENSE file for details.