Skip to content

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

License

Notifications You must be signed in to change notification settings

cek-cek/flutter-emoji

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

flutter_emoji

Build Status Coverage

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

Inspired from the node-emoji package.

Installation

Add this into pubspec.yaml

dependencies:
  flutter_emoji: ">= 2.0.0"

API Usage

First, import the package:

import 'package:flutter_emoji/flutter_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:'

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

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

TODO

Features coming to this package:

  • Get detail of an emoji.
  • Refactor for easier usage.
  • Validate bad input.
  • Find list of available emojis from a given text.
  • Replace emoji by another one.
  • Callback for handling missing emojis on general methods.
  • Auto-update emoji list.
  • Make extensible emoji matcher.

License

MIT @ 2019 Pete Houston.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 98.8%
  • Java 1.2%