Skip to content

famedly/all_emojis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

all_emojis

A comprehensive Dart package that provides access to a complete collection of emojis with detailed metadata, search capabilities, and regex support.

Features

  • 5034+ emojis with detailed metadata
  • Emoji regex pattern matching
  • Emoji search by keywords
  • Group-based emoji filtering
  • Full Unicode emoji support

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  all_emojis: ^0.1.0

Usage

Basic Usage

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

Finding Emojis by Keywords

// 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();

Working with Emoji Groups

// Get animal emojis
final animalEmojis = allEmojis.values
    .where((emoji) => emoji.group == EmojiGroup.animalsNature)
    .map((e) => e.char)
    .take(5)
    .toList();

Emoji Pattern Matching

// 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();

Emoji Properties

Each emoji object contains the following properties:

  • char: The emoji character
  • name: The official emoji name
  • keywords: List of related keywords
  • slug: URL-friendly name
  • group: Emoji category group
  • emojiVersion: The emoji version

Emoji Groups

Emojis are categorized into the following groups:

  • smileysAndEmotion: 😊 😍 😎
  • peopleAndBody: 👋 👨‍👩‍👧‍👦 🧑‍🤝‍🧑
  • animalsNature: 🐶 🐱 🐭
  • foodAndDrink: 🍎 🍕 🍺
  • travelAndPlaces: ✈️ 🏖️ 🏰
  • activities: ⚽️ 🎮 🎨
  • objects: 💡 📱 💻
  • symbols: ❤️ ⭐️ ⚡️
  • flags: 🏁 🏳️ 🏳️‍🌈

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Note

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 emoji
  • emoji.json: provides emoji data in JSON format
  • emoji-regex: a regular expression to match all emoji symbols and sequences

Update the generated emojis to latest Unicode version

  1. cd generator
  2. npm install
  3. npm run generate
  4. Publish it to "pub.dev"

License

This project is licensed under the MIT License - see the LICENSE file for details.

Unicode License Agreement

https://www.unicode.org/license.html

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published