Skip to content

braverhealth/flutter_interactive_keyboard

 
 

Repository files navigation

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.

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;

Packages

No packages published

Languages

  • Dart 45.2%
  • Swift 31.0%
  • Ruby 18.5%
  • Kotlin 3.5%
  • Objective-C 1.8%