flutter_interactive_keyboard 0.1.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 80

pub package

Flutter Interactive Keyboard #

A way to mimic the IOS interactive dismissable keyboard in Flutter. If you're shipping to Android the behavior will sill be applied without animation due to the Android keyboard limitations.

This plugin is still in development, if you'd like to contribute PRs are welcomed.

How to use it #

The KeyboardManagerWidget defines the area where the drag is enabled, the touch are passed to the widget below in order to permit both scroll and drag to dismiss. The focusNode of the textfield is needed 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 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;

0.1.3 #

  • Migrated to AndroidX
  • Migrated to Swift 5
  • Keyboard theme now set to system theme on app launch

0.1.2 #

  • Added method to safely close the keyboard (prevents the fake keyboard to remain on screen)
  • Fixed error that kept the image of the keyboard on screen

0.1.1 #

  • First stable version
  • Added keyboard visibility listeners

0.0.1+1 #

  • Hot fix - Android error fixed

0.0.1 #

  • First release of the package. An interactive way to interact with the virtual keyboard. On IOS devices the intraction is similar to the interactive keyboard dismiss of UIScrollViews

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_interactive_keyboard/flutter_interactive_keyboard.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        resizeToAvoidBottomInset: false,
        appBar: AppBar(
          title: const Text('Interactive Keyboard'),
        ),
        body: Container(
          margin: EdgeInsets.only(top:100),
          child: Column(
            children: <Widget>[
              TextField(
                keyboardAppearance: Brightness.dark,
              ),
              Expanded(
                child: KeyboardManagerWidget(
                  onKeyboardClose: (){
                    print("keyboardClose");
                  },
                  onKeyboardOpen: () {
                    print("keyboardOpen");
                  },
                  child: ListView.builder(
                    itemCount: 100,
                    itemBuilder: (context,index){
                      return ListTile(
                        title: Text("element $index"),
                      );
                    },
                  ),
                )
              )
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_interactive_keyboard: ^0.1.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_interactive_keyboard/flutter_interactive_keyboard.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
60
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

We analyzed this package on Jul 1, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.9+1
  • Flutter: 1.17.3

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:flutter_interactive_keyboard/flutter_interactive_keyboard.dart]

Package does not support Flutter platform macos

Because of import path [package:flutter_interactive_keyboard/flutter_interactive_keyboard.dart]

Package does not support Flutter platform web

Because of import path [package:flutter_interactive_keyboard/flutter_interactive_keyboard.dart]

Package does not support Flutter platform windows

Because of import path [package:flutter_interactive_keyboard/flutter_interactive_keyboard.dart]

Package not compatible with SDK dart

because of import path [flutter_interactive_keyboard]

Health suggestions

Format lib/src/keyboard_manager.dart.

Run flutter format to format lib/src/keyboard_manager.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.0
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test