Expand description
The menu content tree: the six node kinds a caller composes, and the surface partitioning the panel renders them through.
§The six kinds
| Node | Reference | Row |
|---|---|---|
MenuEntry | M3EMenuEntry | a plain action row |
MenuSelectable | M3EMenuSelectable | radio-style: carries a value, checks when selected |
MenuToggleable | M3EMenuToggleable | checkbox-style: carries a checked state |
MenuNode::Divider | M3EMenuDivider | a hairline between sections of one surface |
MenuGroup | M3EMenuGroup | a labelled section — its own elevated surface |
MenuSubmenu | M3EMenuSubmenu | a row that opens a nested panel |
§Surfaces: a group is a container, not an indent
partition_surfaces ports m3eMenuPartitionSurfaces exactly: each
top-level MenuGroup becomes its own elevated menu container, and every
run of consecutive non-group nodes collapses into one implicit, unlabelled
surface. A menu is therefore a stack of cards, not one card with headings.
§Indices
Every rendered row takes one index in a depth-first, pre-order walk of
the tree — a divider counts (it is a row), a submenu row counts and its
children take the indices that follow, and a MenuGroup counts for
nothing of its own (it is a surface, and its label is chrome, not a row).
MenuSelection::index reports that number, so a caller matches on a
number it can read straight off its own node list. MenuNode::span is how
many indices a node and its whole subtree consume (the same shape
frust_shadcn’s menu list uses for its own numbering).
Structs§
- Menu
Entry - A plain action row (
M3EMenuEntry). Build one withmenu_entry. - Menu
Group - A labelled section rendered as its own elevated surface (
M3EMenuGroup). Build one withmenu_group. - Menu
Icon - An icon slot on a menu row.
- Menu
Selectable - A radio-style row carrying a value (
M3EMenuSelectable). Build one withmenu_selectable. - Menu
Selection - One activation reported through a panel’s
on_select. - Menu
Submenu - A row that opens a nested panel (
M3EMenuSubmenu). Build one withmenu_submenu. - Menu
Toggleable - A checkbox-style row (
M3EMenuToggleable). Build one withmenu_toggleable.
Enums§
- Menu
Action - What an activated row asks the app to do.
- Menu
Node - One node in a menu content tree. See the module docs.
Functions§
- menu_
entry - A plain action row labelled
label. - menu_
group - A section holding
children, unlabelled untilMenuGroup::label. - menu_
selectable - A radio-style row labelled
label, reportingvaluewhen chosen. - menu_
submenu - A row labelled
labelopening a nested panel overchildren. - menu_
toggleable - A checkbox-style row labelled
label, currentlychecked. - partition_
surfaces - Partition top-level
nodesinto elevated surface groups — the port ofm3eMenuPartitionSurfaces(m3e_menu_node.dart:272). - spans
- The total span of
nodes— their count plus every nested subtree’s.