flutter_keyboard_visibility
7.0.1, released 3 months ago by jasonrai.ca
Flutter plugin to detect soft keyboard visibility on Android, iOS, web, and desktop.
What it does
Provides a stream of keyboard visibility changes and widgets to react to them. It also offers a widget to dismiss the keyboard on tap and a controller for direct queries.
AI-written summary of version 7.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- Reacting to keyboard visibility changes in the UI
- Dismissing the keyboard when the user taps outside a text field
- Testing keyboard visibility logic in widget tests
Skip it when
- Using it on web where it always reports false
- Relying on it for complex state management beyond keyboard visibility
Strengths
- Cross‑platform support (Android, iOS, web, desktop)
- Simple API with builder, provider, and controller
- Built‑in widget to dismiss keyboard on tap
Weaknesses
- Web support is limited (always false)
- Requires native platform setup for full functionality
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 6
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
KeyboardVisibilityBuilder(
builder: (context, isKeyboardVisible) {
return Text(
'Keyboard is ${isKeyboardVisible ? 'visible' : 'hidden'}',
);
},
);Alternatives
Packages that do the same job and could replace flutter_keyboard_visibility.
- yx_state
A state management library for Dart and Flutter applications.
82Compare - cached_query
Library for caching, background fetching, and managing server state in Dart and Flutter.
90Compare - visibility_aware_state
A State for StatefulWidgets that provides visibility awareness similar to Android activity lifecycles.
48Compare
Works with
Packages commonly used together with flutter_keyboard_visibility: ones it builds on, ones built on it, and its own family.
- introduction_screenBuilt on flutter_keyboard_visibilityAn introduction and onboarding screen package for Flutter apps.
- html_editor_enhancedBuilt on flutter_keyboard_visibilityHTML rich text editor for Android, iOS, and Web using the Summernote library
- keyboard_attachableBuilt on flutter_keyboard_visibilityA Flutter package to build widgets that can be attached to the soft keyboard.
- html_editor_plusBuilt on flutter_keyboard_visibilityHTML rich text editor for Android, iOS, and Web using Summernote
- flutter_cupertino_bottom_sheetBuilt on flutter_keyboard_visibilityCupertino-style bottom sheet that works from any context without a Scaffold, using a screenshot of the screen.
- emoji_keyboard_flutterBuilt on flutter_keyboard_visibilityProvides an emoji keyboard widget and quick emoji popup for Flutter applications.