Search packages, repositories and app categories

avoid_keyboard cover
Package detailsv0.3.0

avoid_keyboard

This package enables convenient keyboard avoidance. It can be used to enable keyboard avoidance for specific view regions, without compressing the entire view.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
957
Likes
26
Pub points
150

Install package

flutter pub add avoid_keyboard

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The avoid_keyboard package provides a simple way to manage keyboard avoidance in Flutter apps, allowing specific view regions to adjust when the keyboard appears. Unlike full-screen adjustments, it avoids compressing the entire UI, preserving layout integrity. It works across multiple platforms including Android, iOS, Web, macOS, Windows, and Linux. The package is ideal for forms or input-heavy screens where maintaining visual context is crucial during user interaction.

Use cases

  • Form inputs with dynamic layout adjustment
  • Chat interfaces with message input fields
  • Custom scrollable regions avoiding keyboard overlap
  • Mobile-first UIs requiring precise keyboard handling
  • Web and desktop apps with responsive input areas

Key features

  • Region-specific keyboard avoidance
  • No full view compression
  • Cross-platform support
  • Minimal setup with widget wrapper
  • Supports scrollable containers
  • Works with existing scroll views

Suitable for

  • Developers building input-heavy apps
  • Teams targeting multiple platforms
  • UI designers needing fine-grained control
  • Apps with complex form layouts
  • Projects requiring smooth keyboard interactions

Considerations

  • May require manual positioning logic for complex layouts
  • Not suitable for full-screen keyboard avoidance
  • Performance impact on high-frequency updates
  • Limited customization beyond basic offset
  • Requires careful testing on all target platforms

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

avoid_keyboard

pub version pub points likes popularity

The avoid_keyboard package includes a widget (AvoidKeyboard) in which you can wrap your text fields and other input controls, such that they will scroll out of the way when the keyboard pops up. Using this widget has an advantage over using the default Scaffold behavior, in that you can specify exactly which areas of your app will scroll in response to the keyboard, rather than having your entire viewport compressed (which won't work anyway for fixed height columns).

Another advantage, is that AvoidKeyboard will only shift its contents in the case that the keyboard is actually overlapping the focused input control.

demonstration gif

Getting Started

To get started, simply wrap the input controls (along with any surrounding portion of the widget tree which should move out of the way):

class AvoidKeyboardExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return AvoidKeyboard(
      child: Column(
        children: [
          TextField(),
          TextField(),
        ],
      ),
    );
  }
}

Having done this, the view will now scroll out of the way when the keyboard overlaps an active control.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.