Easily detect keyboard visibility in your Flutter app with this plugin. It leverages the resizing of the bottom view inset to determine keyboard visibility, ensuring a native Flutter experience.
keyboardDetectionController.state: Get the current keyboard visibility state as a KeyboardState enum.
keyboardDetectionController.stateAsBool([bool includeTransitionalState = false]): Get the keyboard visibility as a bool?. If includeTransitionalState is true, transitional states (visibling, hiding) are included.
keyboardDetectionController.addCallback(callback): Add a callback for state changes. Return true for repeated calls, false to stop.
keyboardDetectionController.stream: Listen to keyboard visibility changes as a stream.
keyboardDetectionController.size: Get the keyboard size. Use keyboardDetectionController.ensureSizeLoaded to ensure the size is loaded.
Limitations
This package uses the bottom inset to detect keyboard visibility, so it doesn't work with floating keyboards (Issue #1).
Contributions
Contributions and feedback are welcome! Feel free to open issues or submit pull requests.