Menu
PaymentMenu keeps secondary actions behind one icon button, usually in a section header or an app bar.




PaymentMenu( trigger: (toggle, node) => PaymentButton( label: 'Options', width: PaymentWidth.hug, variant: PaymentButtonVariant.secondary, size: PaymentSize.small, focusNode: node, onPressed: toggle, ), entries: [PaymentMenuItem(label: 'Download', onSelected: () {})], );Variants
Section titled “Variants”Variants: item, group, custom trigger.
Disabled entries
Section titled “Disabled entries”An entry with onSelected: null is shown disabled. Keep it in the menu when people would otherwise look for it; leave it out when it never applies to them.
Destructive entries
Section titled “Destructive entries”destructive: true draws the entry’s icon and label in the danger tone. Put destructive entries last and confirm them with a dialog.
Phone: action sheet
Section titled “Phone: action sheet”On a phone, when the window’s shorter side is under 600 dp (so in landscape too, D92), the trigger opens a bottom action sheet instead of an anchored menu:
- every entry is a full-width row at least 48 dp tall; when any entry has an icon, every entry keeps the icon column so labels share one edge;
- group titles become captions, and groups are separated by a divider;
- destructive entries move last, after a divider;
- a full-width quiet Cancel sits at the bottom, above the safe area.
The sheet closes first. Then the menu runs the entry’s onSelected or reports its id to onAction, once, and focus returns to the trigger. Cancel, the scrim, swipe down and Escape close it without running anything.
Wide: anchored menu
Section titled “Wide: anchored menu”On a tablet, with a shorter side of 600 dp or more, the menu is built on MenuAnchor. Arrow keys move between entries, Escape closes the menu and focus returns to the button. The panel keeps 16 dp from the window edges. Entries without an icon keep the icon column when a sibling has one. The menu opens instantly: a menu used many times a day should not make people wait for it.
Variants, behavior and migration
Section titled “Variants, behavior and migration”Migration: ActionMenu and ActionMenuEntry are deprecated aliases; rename to PaymentMenu and PaymentMenuItem. Old constructors keep compiling.
Use trigger: (toggle, focusNode) to return PaymentButton or PaymentIconButton. Pass both the toggle callback and focus node so closing restores focus.
Button group now composes related status and dialog actions. Overflow menus wrap long labels at large text.
Migration (UI review P2): on a phone, the callback runs after the sheet closes. A widget test that taps a phone menu entry and checks the callback after a single pump() needs pumpAndSettle().
Which variant when
Section titled “Which variant when”| Situation | Variant / composition | Payment example |
|---|---|---|
| Overflow transaction actions | group | Group related actions; keep the main primary action visible outside overflow. |
Use Select for choosing a field value.
States
Section titled “States”The host supplies enabled and disabled actions. Disabled entries retain their reason; destructive entries appear in a separate final group.
Do and don’t
Section titled “Do and don’t”Do: Group related actions; keep the main primary action visible outside overflow.
Don’t: Use action menus to imitate a form selector.
Content guidelines
Section titled “Content guidelines”- Start each label with a verb: “Copy account ID”, “Export history”.
- Use sentence case and no end punctuation.
- Keep a menu to a handful of entries. Actions people need on every visit belong on the screen, not in a menu.
Accessibility
Section titled “Accessibility”Menu items have labeled targets and visible disabled reasons. Back, Escape and dismissal return focus to the opener.
In the example app
Section titled “In the example app”

PaymentMenu
class PaymentMenu extends StatefulWidget · lib/src/interaction/interaction.dart
Overflow menu behind an icon button.
On tablets it is built on MenuAnchor, so arrow keys move between entries, Escape closes the menu and focus returns to the button; the panel keeps 16 dp from the window edges. On phones (window shortest side under 600 dp, so also in landscape; D92) the trigger opens a bottom action sheet instead (D55): full-width 48 dp rows, group titles as captions, destructive items last after a divider, and a full-width Cancel at the bottom. The sheet closes before the selection is dispatched, and focus returns to the trigger. Opening is instant: a menu used many times a day should not make people wait for it.
| Parameter | Type | Default | Description |
|---|---|---|---|
entries:required | List<PaymentMenuEntry> | — | Menu entries and groups. |
onAction: | ValueChanged<String>? | — | Reports a selected entry identifier. |
icon: | IconData | Icons.more_vert | Default trigger glyph. |
tooltip: | String? | — | Spoken and shown on long-press; defaults to "More actions". |
trigger: | Widget Function(VoidCallback toggle, FocusNode focusNode)? | — | Builds a button using toggle and focusNode for focus return. |
PaymentMenuEntry
abstract class PaymentMenuEntry · lib/src/interaction/interaction.dart
One entry of a PaymentMenu.
PaymentMenuItem
class PaymentMenuItem extends PaymentMenuEntry · lib/src/interaction/interaction.dart
| Parameter | Type | Default | Description |
|---|---|---|---|
label:required | String | — | — |
onSelected: | VoidCallback? | — | Null shows the entry disabled. |
id: | String? | — | — |
disabled: | bool | false | — |
icon: | IconData? | — | — |
destructive: | bool | false | — |
semanticLabel: | String? | — | What screen readers announce instead of label, when the visible label needs more context. Null announces label. |
key: | Key? | — | Key for the rendered entry, so a host can find it, for example with find.byKey. A page link that moves into the menu passes its own key. |
PaymentMenuGroup
class PaymentMenuGroup extends PaymentMenuEntry · lib/src/interaction/interaction.dart
A titled run of menu actions, separated from neighboring groups.
| Parameter | Type | Default | Description |
|---|---|---|---|
title: | String? | — | — |
items:required | List<PaymentMenuItem> | — | — |
ActionMenu
typedef ActionMenu = PaymentMenu · lib/src/interaction/interaction.dart
Deprecated. Use PaymentMenu.
Deprecated alias of PaymentMenu.
ActionMenuEntry
typedef ActionMenuEntry = PaymentMenuItem · lib/src/interaction/interaction.dart
Deprecated. Use PaymentMenuItem.
Deprecated alias of PaymentMenuItem.
See also
Section titled “See also”- Action tile for actions that deserve their own row.
- Dialog to confirm a destructive entry.