Coder Social home page Coder Social logo

anitakym / flutter-emoji Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cek-cek/flutter-emoji

1.0 1.0 0.0 61 KB

๐Ÿ‘‰ A light-weight Emoji ๐Ÿ“ฆ for Flutter with all up-to-date emojis ๐Ÿ˜„. Made from ๐Ÿ’ฏ% โ˜• with โค๏ธ!

Home Page: https://petehouston.com

License: MIT License

Java 1.16% Dart 98.84%

flutter-emoji's Introduction

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.

flutter-emoji's People

Contributors

cek-cek avatar jibbers42 avatar petehouston avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.