搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目