搜尋套件、儲存庫與 APP 分類

套件詳情v0.2.0+2

dart_emoji

一個輕量級的 Emoji 📦,適用於 Dart 與 Flutter,包含所有最新更新的 emoji,完全以純 Dart 編寫 😄。由 💯% ☕ 和 ❤️ 所製造!

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
36
喜歡數
37
Pub 分數
150

安裝套件

flutter pub add dart_emoji

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個輕量級的純 Dart 套件,適用於 Flutter,可存取最新的表情符號。專為輕鬆整合到應用程式中而設計,支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。此套件以效能與簡潔性為核心建構,提供一種簡單的方式在文字中加入表情符號,無需外部相依性。非常適合透過富有表現力且最新版的表情符號字元來增強使用者介面。

適用情境

  • 在UI文字中顯示表情符號
  • 為聊天應用添加表情符號支援
  • 透過視覺反饋增強表單輸入
  • 使用表情符號內容創建富文本
  • 使用表情符號本地化應用內容
  • 建構社群媒體或訊息功能

主要特色

  • 所有最新表情符號
  • 純 Dart 實現
  • 跨平台相容性
  • 輕量級大小
  • 透過 pub 實現輕鬆整合
  • 表情符號名稱查找支援

適合對象

  • 需要表情符支援的 Flutter 開發人員
  • 具備豐富文字或聊天功能的應用程式
  • 優先考慮最小依賴項的專案
  • 希望快速渲染表情符號的開發者
  • 建構國際化應用的團隊

使用建議

  • 可能需要更新以支援新的表情符號標準
  • 僅限表情符號資料(無樣式)
  • 無內建表情符號選擇器
  • 未針對大型表情符號資料集進行優化
  • 依賴GitHub來源以取得最新的表情符號清單

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

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.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案