Giter Club home page Giter Club logo

emojis's Introduction

Emojis

๐Ÿ”ฅ Emoji for Dart ๐Ÿ”ฅ Over 3300 Emojis
This ๐Ÿ“ฆ contain all ๐Ÿ†• Unicode 13.1 Emojis (2๏ธโƒฃ0๏ธโƒฃ2๏ธโƒฃ1๏ธโƒฃ) ๐Ÿ’ช supports null safety ๐Ÿ’ช

๐Ÿ› ๏ธ Usage

0๏ธโƒฃ Import

import 'package:emojis/emojis.dart'; // to use Emoji collection
import 'package:emojis/emoji.dart'; // to use Emoji utilities

1๏ธโƒฃ Use

print('I ${Emojis.greenHeart} ${Emojis.bullseye}'); // I ๐Ÿ’š ๐ŸŽฏ

Emoji? smile = Emoji.byName('hi'); // get a emoji by its name
if (smile != null) {
    print('Emoji name      : ${smile.name}');
    // Emoji name is Grinning Face
    print('Emoji character : ${smile.char}');
    // Emoji character is '๐Ÿ˜€'
    print('Emoji category  : ${smile.emojiGroup}');
    // EmojiGroup.smileysEmotion group of emoji
    print('Emoji sub-group : ${smile.emojiSubgroup}');
    // EmojiSubgroup.faceSmiling sub group of emoji
} else {
  print('Emoji not found!');
}

// get an emoji by its character ๐Ÿ‘ฑโ€โ™€๏ธ
Emoji? womanBlond = Emoji.byChar(Emojis.womanBlondHair)!;
print(womanBlond);

// make blondy in black
Emoji blondyBlackLady = womanBlond.newSkin(fitzpatrick.dark);
print(blondyBlackLady); // ๐Ÿ‘ฑ๐Ÿฟโ€โ™€๏ธ

List<Emoji> emList = Emoji.all(); // list of all Emojis
print(emList[2]); // second emoji in list

// disassemble an emoji
List<String> disassembled = Emoji.disassemble(Emojis.mechanic);
print(disassembled); // ['๐Ÿ”ง', '๐Ÿง‘']

// assemble some emojis
String assembled = Emoji.assemble([Emojis.man, Emojis.man, Emojis.girl, Emojis.boy]);
print(assembled); // ๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๏ธ

String blackThumbsUp = '๐Ÿ‘';
// modify skin tone of emoji
String witheThumbsUp = Emoji.modify(blackThumbsUp, fitzpatrick.light);
print(witheThumbsUp); // ๐Ÿ‘๐Ÿป

// A Woman Police Officer With Brown Skin
String femaleCop =  Emojis.womanPoliceOfficerMediumDarkSkinTone;
// Make that woman to just a Woman Police Officer with no special skin color
String newFemaleCop = Emoji.stabilize(femaleCop);
print('$femaleCop => $newFemaleCop'); //๐Ÿ‘ฎ๐Ÿพโ€โ™€๏ธ => ๐Ÿ‘ฎโ€โ™€๏ธ

// gender-neutral
String aCop = Emoji.stabilize(femaleCop, skin: false, gender: true);
print('$femaleCop => $aCop'); //๐Ÿ‘ฎ๐Ÿพโ€โ™€๏ธ=> ๐Ÿ‘ฎ no gender! still medium dark

final loveEmojis = Emoji.byKeyword('love'); // returns list of lovely emojis :)
print(loveEmojis);
// (๐Ÿฅฐ, ๐Ÿ˜, ๐Ÿ˜˜, ๐Ÿ˜š, ๐Ÿ˜™, ๐Ÿค—, ๐Ÿ˜ป, ๐Ÿ˜ฝ, ๐Ÿ’‹, ๐Ÿ’Œ, ๐Ÿ’˜, ๐Ÿ’, ๐Ÿ’–, ๐Ÿ’—, ๐Ÿ’“, ๐Ÿ’ž, ๐Ÿ’•, ..., ๐Ÿ’„, โ™พ)

final foodCategory = Emoji.byGroup(EmojiGroup.foodDrink); // returns emojis in Food and Drink group
print(foodCategory);
// (๐Ÿ‡, ๐Ÿˆ, ๐Ÿ‰, ๐ŸŠ, ๐Ÿ‹, ๐ŸŒ, ๐Ÿ, ๐Ÿฅญ, ๐ŸŽ, ๐Ÿ, ๐Ÿ, ๐Ÿ‘, ๐Ÿ’, ๐Ÿ“, ๐Ÿฅ, ๐Ÿ…, ๐Ÿฅฅ, ๐Ÿฅ‘, ...)

Iterable<Emoji> moneySubgroupEmojis = Emoji.bySubgroup(EmojiSubgroup.money); // returns emojis in Money subgroup
print(moneySubgroupEmojis);
// (๐Ÿ’ฐ, ๐Ÿ’ด, ๐Ÿ’ต, ๐Ÿ’ถ, ๐Ÿ’ท, ๐Ÿ’ธ, ๐Ÿ’ณ, ๐Ÿงพ, ๐Ÿ’น)

๐Ÿš€ Features

  • All Present unicode emojis ๐Ÿ’ฏ.
  • Get Emojis by Name, Category, Keyword & ...
  • Modify Emoji with ๐Ÿ†• skin color ( ๐Ÿป ๐Ÿผ ๐Ÿฝ ๐Ÿพ ๐Ÿฟ ).
  • Stabilize Emoji (No Skin color, No Gender).
  • Assemble Emojis (๐Ÿ‘ฉ + โค + ๐Ÿ‘ฉ = ๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘ฉ ).
  • Disassemble Emojis (๐Ÿ‘จโ€๐Ÿ”ง = ๐Ÿ”ง + ๐Ÿง‘).
  • Emoji Regex Pattern.
  • Emojize and Demojize text.
  • Find emojis in text.
  • Replace emojis in text.

๐Ÿ“„ License

emojis's People

Contributors

defuncart avatar i-naji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

emojis's Issues

Errors displaying the emojis

Seems like in each category there are some emojis that aren't displayed properly and the emoji is replaced with a rectangle.
This happens for each emoji category:
Screen Shot 2020-12-31 at 4 29 01 PM
Is this a known issue?

Modify API to more closely mirror Flutter's Icon/IconData classes

I want to suggest that some of the core classes in this library be slightly restructured to more closely mimic Flutter's Icon and IconData classes.

For example, the current API looks like this:

Emoji womanBlond = Emoji.byChar(Emojis.womanBlondHair);
print(womanBlond)
// ๐Ÿ‘ง

The proposed API would look like:

Emoji womanBlond = Emoji(Emojis.womanBlondHair);

This library would then have 3 core classes:

/// Houses majority of the API that developers touch. All of your existing methods would stay here
/// plus new ones like `emojize` and `demojize`.
class Emoji {}

/// Empty class but for its many constants representing all of the emojis. This would be most similar
/// to your existing `_emojis` list.
class Emojis {
  ...
  static const womanBlondHair = EmojiData('\u{1F471}\u{200D}\u{2640}\u{FE0F}', shortName: 'blond-haired_woman', emojiGroup: EmojiGroup.peopleBody, emojiSubGroup: EmojiSubGroup.person, keywords: [...])
  ...
}

/// Class to hold instance data for a specific emoji. Thousands of these would exist to populate
/// the `Emojis` container class.
class EmojiData {
  final String code;
  final String shortName;
  final EmojiGroup emojiGroup;
  final EmojiSubGroup emojiSubGroup;
  final List<String> keywords;
}

If this seems reasonable, I would be happy to put together a PR. I have lots of emoji functionality I would love to contribute to your library, but wanted to float my ideas for a refactor before diving right in and making changes.

Thanks again for creating emojis -- you have a lot of very cool functionality here!

Null-safety

Hi! Are you planning on releasing a null-safe version of this package?

Showing the emojis in the App

Seems like the examples are only demonstrating how to print the emojis to the console, which is super inconsequential. How do you include the elements in the actual UI of the app? Seems like the Emoji type is not a Widget type, so I can't just pass it into the tree. Any clarification would be great.

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.