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

flutter_keyboard_size のカバー
パッケージ詳細v1.0.1

flutter_keyboard_size

キーボードの高さ、開いているかどうか、画面が小さいかどうかを設定するための簡単で便利なプロバイダーです。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2万
いいね数
67
Pub ポイント
160

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

flutter pub add flutter_keyboard_size

パッケージ概要

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

flutter_keyboard_size は、画面キーボードの高さや開いているかどうかといったリアルタイム情報を提供する軽量なFlutterパッケージです。また、画面サイズが小さいかどうかを判断するのに役立ち、レスポンシブUIの調整に便利です。このパッケージは、Android、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームで一貫した動作を保証する、シンプルなプロバイダー基盤のAPIを提供しています。キーボードが表示または非表示になったときにレイアウトを動的に変更する必要があるアプリに最適です。

用途

  • キーボードを開いたときにUIレイアウトを調整する
  • フォーム内のキーボードの表示状態を検出する
  • 小さな画面用のレスポンシブデザイン
  • 入力フィールドの位置指定の処理
  • キーボードの高さに基づく動的パディング

主な機能

  • リアルタイムキーボード高さ検出
  • キーボードの開閉状態のモニタリング
  • 画面サイズの分類
  • Provider を使った状態管理
  • クロスプラットフォーム対応
  • シンプルな API インテグレーション

適している対象

  • フォーム中心のアプリケーション
  • チャットまたはメッセージインターフェース
  • モバイルファーストのUI
  • 応答性のあるレイアウト
  • 動的入力処理を必要とするアプリケーション

注意事項

  • 状態の変更時に再ビルドが必要になる場合があります
  • キーボード関連のメトリクスに限定
  • 複雑なジェスチャー検出には適していません
  • プラットフォーム固有のキーボードイベントに依存する
  • Providerなどの状態管理と併用するのが最適です

元の README

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

flutter_keyboard_size Pub

When the virtual keyboard is opened, we can get its height with MediaQuery.of(context).viewInsets.bottom

BUT, in case of complicated widgets tree, it doesn't work. So, every time we have to mutate the keyboard size down to the widget tree.

This package is a straightforward and convenient provider that helps get info about: keyboard height, is it open or not, set bool value is screen small or not.

Showcase|100x100, 10%

Usage

After installing wrap Scaffold widget to

KeyboardSizeProvider(
      smallSize: 500.0,
      child: Scaffold(

where smallSize property is optional, default is 400.0

After that, down to the widget tree you can use Consumer widget to get info about keyboard

Widget build(BuildContext context) {
    return Consumer<ScreenHeight>(
      builder: (context, _res, child) {
        return Center(

available properties:

  double keyboardHeight
  double screenHeight
  bool isSmall // returns true if screen height becomes less then smallSize property
  bool isOpen // true if open

Full example is here https://github.com/awaik/flutter_keyboard_size/tree/master/example

Credits

This is a project by Agoradesk, P2P cryptocurrency trading platform. Created by the team behind LocalMonero, the biggest and most trusted Monero P2P trading platform.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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