dart_emoji 0.2.0+2 copy "dart_emoji: ^0.2.0+2" to clipboard
dart_emoji: ^0.2.0+2 copied to clipboard

A light-weight Emoji πŸ“¦ for Dart & Flutter with all up-to-date emojis written in pure Dart πŸ˜„ . Made from πŸ’―% β˜• with ❀️!

example/README.md

Examples #

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
38
likes
150
points
19
downloads

Publisher

verified publishergatch.fun

Weekly Downloads

A light-weight Emoji πŸ“¦ for Dart & Flutter with all up-to-date emojis written in pure Dart πŸ˜„ . Made from πŸ’―% β˜• with ❀️!

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

characters

More

Packages that depend on dart_emoji