wait_keyboard_height 0.0.1 copy "wait_keyboard_height: ^0.0.1" to clipboard
wait_keyboard_height: ^0.0.1 copied to clipboard

Flutter plugin that emits keyboard height before it shows (ios/android)

Wait Keyboard Height for Flutter #

wait_keyboard_height is a Flutter plugin for iOS and Android that provides the keyboard size before the keyboard animation occurs for showing or hiding it. This helps eliminate lag when positioning widgets around the keyboard, such as placing a TextField above the keyboard.

wait_keyboard_height is a downgraded plugin version flutter sdk and it depends on package ''keyboard_height_plugin: https://pub.dev/packages/keyboard_height_plugin'

Installation #

To install wait_keyboard_height, add it to your pubspec.yaml file under the dependencies section:

dependencies:
  wait_keyboard_height: ^0.0.1

Usage #

To use the wait_keyboard_height, first import it in your Dart file:

import 'package:wait_keyboard_height/wait_keyboard_height.dart';

Next, create a stateful widget and declare a variable to store the keyboard height and create an instance of the KeyboardHeightPlugin:

class _HomePageState extends State<HomePage>; {
  double _keyboardHeight = 0;
  final WaitKeyboardHeight _waitKeyboardHeight_ = WaitKeyboardHeight();
  // ... rest of code ...
}

Then, initialize the WaitKeyboardHeight in your initState method and listen for changes in the keyboard height:

@override
void initState() {
  super.initState();
  _waitKeyboardHeight_.onKeyboardHeightChanged((double height) {
    setState(() {
      _keyboardHeight = height;
    });
  });
}

Use the _keyboardHeight variable to position your widgets around the keyboard.

Example #

For a complete example on how to use the wait_keyboard_height, please refer to the example directory in the repository.

Contributing #

If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the project's GitHub repository.

License #

This plugin is licensed under the BSD 3-Clause License.

4
likes
150
points
70
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin that emits keyboard height before it shows (ios/android)

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on wait_keyboard_height

Packages that implement wait_keyboard_height