연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
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', '❤️');
var emojiHeart = parser.info('heart');
print(emojiHeart); '{name: heart, full: :heart:, code: ❤️}'
heart == emojiHeart;
heart == emojiCoffee;
parser.get('coffee');
parser.get(':coffee:');
parser.hasName('coffee');
parser.getName('coffee');
parser.hasEmoji('❤️');
parser.getEmoji('❤️');
parser.emojify('I :heart: :coffee:');
parser.unemojify('I ❤️ ☕');
EmojiUtil.hasOnlyEmojis("👋");
EmojiUtil.hasOnlyEmojis("👋 Hello");
All methods will return Emoji.None if emoji is not found.
parser.get('does_not_exist_emoji_name');
License
MIT @ 2021 Gatch GmbH.