Overview
The keyboard_visibility package is a Flutter plugin that enables developers to detect the visibility state of the soft keyboard on both Android and iOS devices. It provides a simple API to listen for keyboard show/hide events, allowing apps to respond dynamically—such as adjusting layouts or scrolling content into view. This is particularly useful in forms or chat interfaces where user input requires visual feedback. The plugin works seamlessly across platforms with minimal setup, making it ideal for responsive UIs.
Use cases
- Form input handling
- Chat app UI adjustments
- Dynamic layout resizing
- Scrolling to focused fields
- Responsive user interfaces
Key features
- Real-time keyboard state detection
- Cross-platform support (Android & iOS)
- Simple event listener API
- Minimal configuration
- Works with FocusNode and TextEditingController
Suitable for
- Developers building form-heavy apps
- Chat or messaging applications
- UIs requiring dynamic keyboard-aware layouts
- Apps needing responsive input handling
- Flutter beginners exploring platform-specific features
Considerations
- Does not work on web platform
- Requires proper event listener management
- May need additional logic for complex UI transitions
- Limited to keyboard visibility, not size or animation
- No built-in animations or transitions