1.0.3 β’ Published 2 years ago
unicode-emoji-dart v1.0.3
Unicode Emoji Dart
This library takes the latest available emoji dataset (v15.1) from Unicode and generates Dart objects from it. It uses the following libraries to compile the dataset:
emojilib: provides a list of keywords for every emojiunicode-emoji-json: provides emoji data in JSON formatemoji-regex: a regular expression to match all emoji symbols and sequences
Generate Dart files
As repo clone
git clone https://github.com/alfalcon90/unicode-emoji-dart.gitClone this repo.npm installInstall dependencies.npm run generateCheck the/exportfolder once the script is done.
As npm dependency
npm add unicode-emoji-dartAdd this package.npm add -D @types/node typescriptAdd Typescript devDependencies if not done already.npm explore unicode-emoji-dart -- npm run generateCheck thenode_modules/unicode-emoji-dart/exportfolder once the script is done.
Usage
// Emoji Map
emojis.length; // 1870 emojis
// Emoji class
final emoji = emojis['π¨πΊ']!;
emoji.char; // 'π¨πΊ'
emoji
.keywords; // ['flag_cuba','cu','flag','nation','country','banner','cuba']
emoji.name; // 'flag Cuba'
emoji.slug; // 'flag_cuba'
emoji.group; // EmojiGroup.flags
emoji.emojiVersion; // 2.0
emoji.unicodeVersion; // 2.0
emoji.skinToneSupport; // false
emoji.skinToneSupportUnicodeVersion; // null
// Equality
final other = emojis['πΊπΈ']!;
emoji == other; // false
// Regex
regex.hasMatch('Loud noises! π£'); // true