パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.5.6

keyboard_visibility

Android および iOS でソフトキーボードの表示状態を検出するための Flutter プラグイン。

30日間ダウンロード
735
いいね数
122
Pub ポイント
35

パッケージをインストール

flutter pub add keyboard_visibility

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

keyboard_visibility パッケージは、Android および iOS デバイス上のソフトキーボードの表示状態を検出できる Flutter プラグインです。キーボードの表示・非表示イベントをリッスンするためのシンプルな API を提供し、アプリが動的に応答できるようにします(たとえば、レイアウトを調整したり、コンテンツをビュー内にスクロールしたり)。フォームやチャットインターフェースでは、ユーザー入力に視覚的なフィードバックが必要となるため、特に有用です。このプラグインは最小限の設定でクロスプラットフォームでシームレスに動作し、応答性のある UI に最適です。

用途

  • フォーム入力の処理
  • チャットアプリUIの調整
  • ダイナミックレイアウトのリサイズ
  • フォーカスされたフィールドにスクロール
  • 応答性のあるユーザーインターフェース

主な機能

  • リアルタイムキーボード状態検出
  • クロスプラットフォーム対応(Android および iOS)
  • シンプルなイベントリスナーAPI
  • 最小構成
  • FocusNode および TextEditingController と連携可能

適している対象

  • フォーム中心のアプリを開発する開発者
  • チャットまたはメッセージングアプリケーション
  • 動的キーボード対応レイアウトを必要とするUI
  • 応答性のある入力処理を必要とするアプリ
  • Flutterの初心者がプラットフォーム固有の機能を探索する

注意事項

  • Web プラットフォームでは動作しません
  • 適切なイベントリスナーの管理が必要です
  • 複雑なUI遷移には追加の論理が必要になる場合があります
  • キーボードの表示状態に限定され、サイズやアニメーションではない
  • 組み込みのアニメーションやトランジションはありません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

keyboard_visibility

Notification service for soft-keyboard visibility

Usage

Add the dependency to your pubspec.yaml file in the root folder of your project. Look for the 'dependencies:'-line and add the following line after this line:

keyboard_visibility: any

or

keyboard_visibility: ^[CURRENT VERSION NUMBER]

(Please note that the two spaces in the beginning of the line are important) Run 'flutter packages get' in your root folder after saving the pubspec.yaml file. For additional documentation about the pubspec.yaml file please refer to the official flutter documentation using packages

Import package:keyboard_visibility/keyboard_visibility.dart, instantiate KeyboardVisibilityNotification and use the Android and iOS notifications to get events about changes of the visibility of the soft-keyboard

The best practice to call the addNewListener function is inside the initState function as in the following example:

import 'package:keyboard_visibility/keyboard_visibility.dart';

@protected
void initState() {
  super.initState();

  KeyboardVisibilityNotification().addNewListener(
    onChange: (bool visible) {
      print(visible);
    },
  );
}

Also check out the example included with the package

Getting Started

For help getting started with Flutter, view the following online documentation.

カテゴリー

ソースリポジトリ

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