KeyboardHeightPlugin class

A plugin that provides keyboard height before the keyboard animation occurs.

This helps eliminate lag when positioning widgets around the keyboard, such as placing a TextField above the keyboard.

The plugin uses platform channels to get the keyboard height from native code before Flutter's viewInsets are updated.

Constructors

KeyboardHeightPlugin()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Disposes the plugin and cancels any active subscriptions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onKeyboardHeightChanged(KeyboardHeightCallback callback) → void
Registers a callback to be called when the keyboard height changes.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

lastKnownKeyboardHeight double
Gets the last known keyboard height (includes safe area). Returns 0 if keyboard has never been opened.
no setter
lastKnownSafeAreaBottom double
Gets the last known safe area bottom.
no setter

Static Methods

setLastKnownKeyboardHeight(double height) → void
Sets the last known keyboard height. This can be called from sticker/emoji keyboard to cache the height when switching from OS keyboard to custom keyboard.