Skip to content
pubscout

avoid_keyboard

0.3.0, released 5 years ago by an unverified publisher

A widget that scrolls specific input controls out of the way when the keyboard appears.

WASM-ready
$ flutter pub add avoid_keyboard
Source repository

What it does

The avoid_keyboard package includes an AvoidKeyboard widget to wrap text fields and input controls. It shifts contents only if the keyboard actually overlaps the focused input control, without compressing the entire viewport.

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

Use it when

  • You want specific view regions to avoid the keyboard instead of compressing the entire view
  • You have fixed height columns where default Scaffold resizing fails
  • You need input controls to scroll into view when traversed via keyboard focus events

Skip it when

  • You prefer the default Scaffold resizing behavior for the entire viewport

Strengths

  • Only shifts contents when the keyboard overlaps the focused input control
  • Allows avoiding keyboard for specific view regions rather than the whole screen
  • Responds to focus traversal events while the keyboard is up

Weaknesses

  • Limited documentation regarding advanced configuration options
  • Depends on the specific layout structures supported by the widget

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
class AvoidKeyboardExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return AvoidKeyboard(
      child: Column(
        children: [
          TextField(),
          TextField(),
        ],
      ),
    );
  }
}

Alternatives

Packages that do the same job and could replace avoid_keyboard.

Works with

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