Skip to content
pubscout

keyboard_insets

0.1.2, released a year ago by 2gis.ru

Provides real‑time keyboard height and visibility streams for Flutter apps.

WASM-ready
$ flutter pub add keyboard_insets
Source repository

What it does

The plugin emits per‑frame keyboard inset values and a state stream indicating visibility and animation status. It also offers a SafeArea widget that keeps bottom padding stable during keyboard animations.

AI-written summary of version 0.1.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need precise keyboard height for custom UI adjustments
  • You want to react to keyboard visibility without using MediaQuery
  • You need a stable bottom safe‑area while the keyboard animates

Skip it when

  • You only need occasional keyboard height (MediaQuery is sufficient)
  • You target platforms without keyboard support (e.g., desktop)

Strengths

  • High‑frequency per‑frame updates
  • Cross‑platform (iOS, Android, Web)
  • Lightweight FFI implementation
  • Provides a SafeArea replacement

Weaknesses

  • Desktop returns zero insets (no keyboard support)
  • Requires iOS deployment target ≥13.0

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
3

Add dependency, ensure iOS Podfile sets platform to '13.0' or higher; no additional permissions required.

import 'package:keyboard_insets/keyboard_insets.dart';

void main() {
  KeyboardInsets.insets.listen((height) {
    print('Keyboard height: $height');
  });
  KeyboardInsets.stateStream.listen((state) {
    print('Visible: ${state.isVisible}, Animating: ${state.isAnimating}');
  });
}

Alternatives

Packages that do the same job and could replace keyboard_insets.

Works with

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