搜尋分類、套件與程式碼儲存庫

keyboard_emoji_picker 封面
套件詳情v1.0.3

keyboard_emoji_picker

使用設備鍵盤選擇表情符號的 Flutter 插件。

iOS
近 30 天下載
1220
喜歡數
31
Pub 分數
150

安裝套件

flutter pub add keyboard_emoji_picker

套件介紹

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

一個 Flutter 插件,允許使用者透過裝置的原生鍵盤直接挑選表情符號。它與 iOS 鍵盤無縫整合,可在不切換輸入法的情況下順暢選擇表情符號。該套件透過提供快速存取表情符號的功能,提升訊息與文字輸入介面的使用者體驗。它輕量級且專為 iOS 設計,利用平台特定的鍵盤功能。非常適合需要直覺式表情符號互動的應用。

適用情境

  • 訊息應用
  • 社群媒體平台
  • 評論區段
  • 使用者個人檔案描述
  • 互動式聊天介面

主要特色

  • 原生 iOS 鍵盤整合
  • 無縫表情符號選擇
  • 輕量級實作
  • 平台特定優化
  • 透過 Flutter pub 輕鬆設定

適合對象

  • 針對 iOS 的 Flutter 應用
  • 大量文字輸入的應用程式
  • 情感豐富的溝通工具
  • 簡單表情符號選擇器需要
  • 重視原生使用者體驗的開發者

使用建議

  • 僅限 iOS
  • 無 Android 支持
  • 依賴設備鍵盤行為
  • 可能需要在不同版本的iOS上進行測試
  • 最小的自定選項

原始 README

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

The keyboard_emoji_picker package provides a simple way to use the device's native emoji keyboard to pick an emoji. It's currently supported on iOS only. However, adding support for Android is something I'd like to do in the future (if you'd like to help, please let me know).

Demo

Usage

To use KeyboardEmojiPicker, you need to have a KeyboardEmojiPickerWrapper widget somewhere in your widget tree. This widget will create a hidden input field in order to make opening the keyboard possible.

import 'package:keyboard_emoji_picker/keyboard_emoji_picker.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // While this example wraps [MaterialApp], you don't have to.
    // You can put it wherever you want to use the picker.
    return KeyboardEmojiPickerWrapper(
      child: MaterialApp(
        title: 'My App',
        home: MyHomePage(),
      ),
    );
  }
}
Checking if the keyboard is available

Since the package uses the device's keyboard, it's not always available. For example, if the user has disabled the emoji keyboard, it won't open and will throw a NoEmojiKeyboardFound exception.

To check if the keyboard is available, you can use the checkHasEmojiKeyboard method.

final hasEmojiKeyboard = await KeyboardEmojiPicker().checkHasEmojiKeyboard();

if (hasEmojiKeyboard) {
  // Open the keyboard.
} else {
  // Use another way to pick an emoji or show a dialog asking the user to
  // enable the emoji keyboard.
}
Picking an emoji

To pick an emoji, use the pickEmoji method. It will open the keyboard and wait for the user to pick an emoji. If the user closes the keyboard, the method will return null.

It is highly recommended to check if the keyboard is available before calling this method to avoid exceptions.

final emoji = await KeyboardEmojiPicker().pickEmoji();
if (emoji != null) {
  // Do something with the emoji
} else {
  // The emoji picking process was cancelled (usually, the keyboard was closed).
}
Closing the keyboard

Since the plugin uses a different hidden input than Flutter itself, you need to close the keyboard manually. To do so, use the closeKeyboard method.

KeyboardEmojiPicker().closeKeyboard();

Contributing

Contributions are welcome and appreciated! Feel free to open an issue or a pull request!

所屬分類

依賴

依賴清單 1 項

  • plugin_platform_interface^2.0.2

原始碼儲存庫

使用此套件的專案

暫無相關資料。