Pakete, Repositories und App-Kategorien suchen

GitHub-RepositoryGatchHQ/dart-emoji

dart-emoji

Ein leichtgewichtiger Emoji 📦 für Dart und Flutter mit allen aktuellsten Emojis, die rein in Dart geschrieben sind 😄. Hergestellt aus 💯% ☕ mit ❤️!

Projektcover von dart-emoji
Sterne
20
Forks
2
Letzter Push (UTC)
24.07.2024
Projektstatus
Aktiv

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

dart_emoji

👉 A light-weight Emoji 📦 for Dart & Flutter with all up-to-date emojis written in pure Dart 😄 . Made from 💯% ☕ with ❤️!

This is a fork of flutter_emoji, which is inspired by the node-emoji package. The reason for the fork is better maintaining and adding further features, such as EmojiUtil.hasOnlyEmojis().

dart_emoji is even used in production for our app Gatch. You can get Gatch for iOS and Android.

API Usage

First, import the package:

import 'package:dart_emoji/dart_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:'

// 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

License

MIT @ 2021 Gatch GmbH.

Gatch GitHub avatar
GitHub-Autor

Gatch ↗

SprachenDart

Kategorien

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 2 Einträge

Wie wähle ich ein passendes Repository?

Nach Anwendungsfall filtern, Aktivität vergleichen und vor der Nutzung das Originalprojekt prüfen.

  1. Nach Name, Autor oder Beschreibung suchen und nach Thema eingrenzen.
  2. Sterne, Forks und letzte Pushes vergleichen. Sterne zeigen Interesse, garantieren aber keine Qualität.
  3. Vor der Nutzung README, Lizenz und Issues auf GitHub prüfen.

Quellen und Pflege

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗