FLUTTER ECOSYSTEM

mcrovero/flutter_interactive_keyboard

詳細は https://medium.com/@mattia_crovero/interactive-keyboard-in-flutter-5d7ac6ee096b を参照してください

flutter_interactive_keyboard のプロジェクト画像
Stars
54
Forks
28
最終プッシュ(UTC)
2021/04/12
プロジェクト状態
公開中
Mattia Crovero GitHub avatar
GITHUB User

Mattia Crovero ↗

Full stack developer @ Ujiboo Srl

Ujiboo SrlItaly, Turin公式サイト ↗
言語DartSwiftRubyKotlinObjective-C

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 2 件
  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

pub package

This plugin is not under active development. If you'd like to contribute, PRs are welcomed.

Flutter Interactive Keyboard

A way to mimic the iOS interactive dismissable keyboard in Flutter. For Android, the behavior will still be applied without animation due to the Android keyboard limitations.

https://github.com/mcrovero/flutter_interactive_keyboard/raw/master/assets/demo1.gif

How to use it

The KeyboardManagerWidget defines the area where the draggable keyboard is enabled. Gestures are passed to the widget in order to permit both scrolling and drag-to-dismiss behavior.

focusNode is required when using a TextField to manage the keyboard opening and closing.

See the full example to see a complete implementation.

KeyboardManagerWidget(
  focusNode: _focusNode,
  child: ListView.builder(
    itemCount: 100,
    itemBuilder: (context,index){
      return ListTile(
        title: Text("element $index"),
      );
    },
  ),
)

Advanced

Change focusNode

If your app has more than one TextField that should trigger the keyboard, you can change the current FocusNode from the KeyboardManagerWidgetState as follows:

// Init variable
GlobalKey<KeyboardManagerWidgetState> _key = GlobalKey();

// In the build method
KeyboardManagerWidget(
  key: _key,
  ...
)

// Wherever you like
_key.currentState.substituteFocusNode = newFocusNode;