カテゴリー・パッケージ・リポジトリを検索

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 アプリ
  • 大量のテキスト入力を行うアプリ
  • 感情豊かなコミュニケーションツール
  • シンプルな絵文字ピッカーが必要
  • ネイティブUXを最優先とする開発者

注意事項

  • 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

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。