emojis 0.8.1

Emojis #

๐Ÿ”ฅ Emoji for Dart ๐Ÿ”ฅ Over 3200 Emojis
This ๐Ÿ“ฆ contain all ๐Ÿ†• Unicode 12.1 Emojis (2๏ธ0๏ธ2๏ธ0๏ธ)

๐Ÿ› ๏ธ Usage #

0๏ธโƒฃ Import

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

1๏ธโƒฃ Use

var message = 'Made with ${Emojis.redHeart} by Naji.'; // message: Made with โค๏ธ by Naji.

Emoji smile = Emoji.byName('Grinning Face'); // get a emoji by its name
print(smile.name);
// 'Grinning Face' name of emoji
print(smile.char);
// '๐Ÿ˜€' character of emoji
print(smile.emojiGroup);
// EmojiGroup.smileysEmotion group of emoji
print(smile.emojiSubgroup);
// EmojiSubgroup.faceSmiling sub group of emoji

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

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

var emList = Emoji.all(); // list of all Emojis 

print(Emoji.disassemble(Emojis.mechanic)); // ['๐Ÿ”ง', '๐Ÿง‘']

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

print(Emoji.modify('๐Ÿ‘', fitzpatrick.light)); // ๐Ÿ‘๐Ÿป

print(Emoji.stabilize(Emojis.womanPoliceOfficerMediumDarkSkinTone)); //๐Ÿ‘ฎ๐Ÿพโ€โ™€๏ธ => ๐Ÿ‘ฎโ€โ™€๏ธ Woman Police Officer with no special skin tone
print(Emoji.stabilize(Emojis.womanPoliceOfficerMediumDarkSkinTone, skin: false, gender: true)); //๐Ÿ‘ฎ๐Ÿพโ€โ™€๏ธ => ๐Ÿ‘ฎ no gender! still medium dark

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

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

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

๐Ÿš€ Features #

[ ] Emojize and Demojize text
[ ] Find emojis in text
[ ] Replace emojis in text

๐Ÿ“„ License #

[0.8.1]

  • Remove generator
  • Use last stable version unicode 12.1
  • Add library emoji and remove alias.

[0.0.1]

  • Emojis class contains all released emojis (v13)

example/main.dart

import 'package:emojis/emojis.dart';
import 'package:emojis/emoji.dart';

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

  Emoji smile = Emoji.byName('Grinning Face'); // get a emoji by its name
  print(smile.name);
// 'Grinning Face' name of emoji
  print(smile.char);
// '๐Ÿ˜€' character of emoji
  print(smile.emojiGroup);
// EmojiGroup.smileysEmotion group of emoji
  print(smile.emojiSubgroup);
// EmojiSubgroup.faceSmiling sub group of emoji

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

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

  var emList = Emoji.all(); // list of all Emojis

  print(Emoji.disassemble(Emojis.mechanic)); // ['๐Ÿ”ง', '๐Ÿง‘']

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

  print(Emoji.modify('๐Ÿ‘', fitzpatrick.light)); // ๐Ÿ‘๐Ÿป

  print(Emoji.stabilize(Emojis.womanPoliceOfficerMediumDarkSkinTone)); //๐Ÿ‘ฎ๐Ÿพโ€โ™€๏ธ => ๐Ÿ‘ฎโ€โ™€๏ธ Woman Police Officer with no special skin tone
  print(Emoji.stabilize(Emojis.womanPoliceOfficerMediumDarkSkinTone, skin: false, gender: true)); //๐Ÿ‘ฎ๐Ÿพโ€โ™€๏ธ => ๐Ÿ‘ฎ no gender! still medium dark

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

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

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

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  emojis: ^0.8.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:emojis/emojis.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
43
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

We analyzed this package on Feb 12, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health issues and suggestions

Document public APIs. (-0.83 points)

3326 out of 3345 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/emoji.dart. (-1.99 points)

Analysis of lib/src/emoji.dart reported 4 hints:

line 46 col 123: Use = to separate a named parameter from its default value.

line 119 col 61: Use = to separate a named parameter from its default value.

line 179 col 52: Use = to separate a named parameter from its default value.

line 179 col 70: Use = to separate a named parameter from its default value.

Format lib/src/unicode_emojis.dart.

Run dartfmt to format lib/src/unicode_emojis.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.10.0