Skip to content
pubscout

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.

WASM-ready
$ flutter pub add flutter_keyboard_visibility
Source repository

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.

  • cached_query

    Library for caching, background fetching, and managing server state in Dart and Flutter.

  • visibility_aware_state

    A State for StatefulWidgets that provides visibility awareness similar to Android activity lifecycles.

Works with

Packages commonly used together with flutter_keyboard_visibility: ones it builds on, ones built on it, and its own family.