keyboard_height_plugin
0.3.0, released 8 months ago by noahschairer.com
Emits keyboard height before it shows on iOS and Android to prevent layout lag
WASM-ready
What it does
A Flutter plugin for iOS and Android that provides the keyboard size before the keyboard animation occurs. This allows developers to position widgets like TextFields precisely without lag.
AI-written summary of version 0.3.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to know the exact keyboard height before it animates onto the screen
- You want to eliminate lag when positioning widgets around the software keyboard
Skip it when
- Your project cannot upgrade to modern build tools required by version 0.3.0 without staying on legacy version 0.1.5
- Standard Flutter padding/MediaQuery insets are sufficient for your layout
Strengths
- Provides keyboard height before the animation occurs
- Supports both iOS and Android
- Includes privacy manifest for iOS App Store compliance
Weaknesses
- Requires modern Android build tooling (AGP 8.6.0+, Gradle 8.7+, Kotlin 2.1.0+, Java 17+) for version 0.3.0
- Limited to keyboard height emission rather than a full suite of device tools
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Requires ensuring compatible Android build tools (AGP 8.6+, Java 17+, Kotlin 2.1+) for version 0.3.0.
import 'package:keyboard_height_plugin/keyboard_height_plugin.dart';
double _keyboardHeight = 0;
final KeyboardHeightPlugin _keyboardHeightPlugin = KeyboardHeightPlugin();
@override
void initState() {
super.initState();
_keyboardHeightPlugin.onKeyboardHeightChanged((double height) {
setState(() {
_keyboardHeight = height;
});
});
}Works with
Packages commonly used together with keyboard_height_plugin: ones it builds on, ones built on it, and its own family.