Skip to content
pubscout

keyboard_avoider

0.2.0, released 3 years ago by martinrybak.com

A lightweight alternative to Scaffold for avoiding the on-screen software keyboard.

WASM-ready
$ flutter pub add keyboard_avoider
Source repository

What it does

Automatically adjusts its padding to avoid the on-screen keyboard and can scroll obscured TextField child widgets into view on focus. It can be applied selectively to specific widgets rather than requiring a full-screen Scaffold.

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

Use it when

  • You want to avoid the on-screen software keyboard without using a full-screen Scaffold
  • You need to automatically scroll focused TextFields into view
  • You want to inset padding only by the actual amount obscured by the keyboard

Skip it when

  • You are already satisfied with the default behavior of Flutter's built-in Scaffold resize properties
  • You need sophisticated layout engines not covered by standard single-child scroll views

Strengths

  • Lightweight alternative to Scaffold
  • Selectively applied to specific areas rather than the whole screen
  • Supports auto-scrolling focused child widgets into view

Weaknesses

  • Limited configuration options documented beyond basic properties like autoScroll
  • Relies on standard ScrollView wrapping when autoScroll is enabled

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:keyboard_avoider/keyboard_avoider.dart';

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return KeyboardAvoider(
      child: Placeholder(),
    );
  }
}

Alternatives

Packages that do the same job and could replace keyboard_avoider.