Search packages, repositories and app categories

Package detailsv0.2.0+2

dart_emoji

A light-weight Emoji 📦 for Dart & Flutter with all up-to-date emojis written in pure Dart 😄 . Made from 💯% ☕ with ❤️!

AndroidiOSWebmacOSWindowsLinux
30-day downloads
36
Likes
37
Pub points
150

Install package

flutter pub add dart_emoji

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A lightweight, pure Dart package for Flutter that provides access to the latest emojis. Designed for easy integration into apps, it supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux. The package is built with performance and simplicity in mind, offering a straightforward way to include emojis in text without external dependencies. Perfect for enhancing user interfaces with expressive, up-to-date emoji characters.

Use cases

  • Displaying emojis in UI text
  • Adding emoji support to chat applications
  • Enhancing form inputs with visual feedback
  • Creating rich text with emoji content
  • Localizing app content with emoji
  • Building social media or messaging features

Key features

  • All up-to-date emojis
  • Pure Dart implementation
  • Cross-platform compatibility
  • Lightweight size
  • Easy integration via pub
  • Emoji name lookup support

Suitable for

  • Flutter developers needing emoji support
  • Apps with rich text or chat features
  • Projects prioritizing minimal dependencies
  • Developers wanting fast emoji rendering
  • Teams building internationalized apps

Considerations

  • May require updates for new emoji standards
  • Limited to emoji data only (no styling)
  • No built-in emoji picker
  • Not optimized for large emoji datasets
  • Depends on GitHub source for latest emoji list

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

dart_emoji

👉 A light-weight Emoji 📦 for Dart & Flutter with all up-to-date emojis written in pure Dart 😄 . Made from 💯% ☕ with ❤️!

This is a fork of flutter_emoji, which is inspired by the node-emoji package. The reason for the fork is better maintaining and adding further features, such as EmojiUtil.hasOnlyEmojis().

dart_emoji is even used in production for our app Gatch. You can get Gatch for iOS and Android.

API Usage

First, import the package:

import 'package:dart_emoji/dart_emoji.dart';

There are two main classes you need to know to handle Emoji text: Emoji and EmojiParser.

Basically, you need to initialize an instance of EmojiParser.

var parser = EmojiParser();
var coffee = Emoji('coffee', '☕');
var heart  = Emoji('heart', '❤️');

// Get emoji info
var emojiHeart = parser.info('heart');
print(emojiHeart); '{name: heart, full: :heart:, code: ❤️}'

// Check emoji equality
heart == emojiHeart;  // returns: true
heart == emojiCoffee; // returns: false

// Get emoji by name or code
parser.get('coffee');   // returns: Emoji{name="coffee", full=":coffee:", code="☕"}
parser.get(':coffee:'); // returns: Emoji{name="coffee", full=":coffee:", code="☕"}

parser.hasName('coffee'); // returns: true
parser.getName('coffee'); // returns: Emoji{name="coffee", full=":coffee:", code="☕"}

parser.hasEmoji('❤️'); // returns: true
parser.getEmoji('❤️'); // returns: Emoji{name="heart", full=":heart:", code="❤️"}

parser.emojify('I :heart: :coffee:'); // returns: 'I ❤️ ☕'
parser.unemojify('I ❤️ ☕'); // returns: 'I :heart: :coffee:'

// Check if text contains only emojis
EmojiUtil.hasOnlyEmojis("👋"); // returns true
EmojiUtil.hasOnlyEmojis("👋 Hello"); // returns false

All methods will return Emoji.None if emoji is not found.

parser.get('does_not_exist_emoji_name'); // returns: Emoji.None

License

MIT @ 2021 Gatch GmbH.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package