Search packages, repositories and app categories

keep_keyboard_popup_menu cover
Package detailsv2.0.5

keep_keyboard_popup_menu

A popup menu that will keep keyboard open.

30-day downloads
27
Likes
29
Pub points
45

Install package

flutter pub add keep_keyboard_popup_menu

Package Overview

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

A Flutter package that enables a popup menu to remain open while keeping the keyboard active, ensuring a seamless user experience during input-heavy interactions. It is particularly useful in forms or text entry scenarios where users need to select options from a menu without losing focus on the text field. The package works by preventing the keyboard from closing when the popup menu is triggered, maintaining continuity in user workflows. Designed for simplicity and reliability, it integrates smoothly with existing Flutter applications.

Use cases

  • Form inputs with dropdown selections
  • Text fields requiring frequent menu access
  • User flows needing continuous keyboard focus
  • Interactive dialogs with input elements
  • Dynamic option selection during typing

Key features

  • Keeps keyboard open after menu appears
  • Minimal setup and integration
  • Works with standard TextField widgets
  • Maintains input focus during interaction
  • Lightweight and efficient

Suitable for

  • Developers building form-heavy apps
  • Apps with frequent menu interactions
  • UX-focused interfaces requiring smooth input flow
  • Mobile apps with complex data entry
  • Flutter projects prioritizing user retention

Considerations

  • Limited to mobile platforms (no web/desktop support)
  • May conflict with other focus management packages
  • Requires careful handling in nested scroll contexts
  • Not suitable for modal dialogs requiring full screen transitions
  • Depends on underlying platform-specific keyboard behavior

Original README

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

This Library was meant for an old version of flutter (v1) and doesn't work on the new version!

keep_keyboard_popup_menu

A popup menu that will keep the soft keyboard open. This package is created to solve issue #24843 and #50567.

How Does It Work?

Unlike the popup menu created by PopupMenuButton, which works by pushing a new route to the navigator and causes the soft keyboard to hide, the popup menu created by this package works by adding an entry to Overlay and will keep the soft keyboard open.

Quick Start

(I'm sorry for the long names, please pr if there are shorter alternatives.)

KeepKeyboardPopupMenuItem

Intended to replace PopupMenuItem. Works similarly to a ListTile. PopupMenuItem won't work with this package because it will pop the current route when tapped. (This package shows popup menu using overlay, not route.)

KeepKeyboardPopupMenuItem(
    child: Text('awa'),
    onTap: () {},
)

KeepKeyboardPopupMenuButton

Intended to replace PopupMenuButton. Despite the similar name, the usage is quite different. The closePopup passed to the menuItemBuilder is used to programmatically close the popup.

KeepKeyboardPopupMenuButton(
    menuItemBuilder: (context, closePopup) => [
        KeepKeyboardPopupMenuItem(
            child: Text('awa'),
            onTap: closePopup,
        ),
    ]
)

You can also use the menuBuilder property to show any widget you want in the popup menu. For details, see the documentation and example.

WithKeepKeyboardPopupMenu

WithKeepKeyboardPopupMenu allows opening a popup menu on any widget.

WithKeepKeyboardPopupMenu(
    menuItemBuilder: (context, closePopup) => [
        KeepKeyboardPopupMenuItem(
            child: Text('awa'),
            onTap: closePopup,
        ),
    ],
    childBuilder: (context, openPopup) => ElevatedButton(
        onPressed: openPopup,
        child: Text('Custom Trigger'),
    ),
    
)

You can also use the menuBuilder property to show any widget you want in the popup menu, use backgroundBuilder property to customize background of the popup menu, and calculatePopupPosition property to customize the position of the popup menu. For details, see the documentation and example.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.