CNToolbarMenu class

A toolbar button that opens a menu.

The entries are those of CNPopupMenuButton (items with icons, subtitles, checkmarks; dividers; submenus). NSMenuToolbarItem on macOS, a UIBarButtonItem with a UIMenu on iOS 26+.

Inheritance

Constructors

CNToolbarMenu({String? id, required String label, required List<CNPopupMenuEntry> items, CNSymbol? icon, IconData? customIcon, CNImageAsset? imageAsset, String? tooltip, bool enabled = true, bool showsIndicator = true, bool centered = false, ValueChanged<List<int>>? onSelected})
Creates a menu item.
const

Properties

centered → bool
Whether the button sits in the middle of the window toolbar (macOS 13+).
final
customIcon → IconData?
An icon font glyph, rendered by Flutter.
final
enabled → bool
Whether the menu can be opened.
final
hashCode → int
The hash code for this object.
no setterinherited
icon → CNSymbol?
SF Symbol of the button. Priority: imageAsset > customIcon > icon.
final
id → String?
Identifies the item across rebuilds, so a change updates the native item in place. Unique within a toolbar. Without one, an item is known by its kind and its position among the items of that kind.
finalinherited
imageAsset → CNImageAsset?
An image asset or bytes.
final
items → List<CNPopupMenuEntry>
The entries of the menu.
final
label → String
The name of the menu button; its title when it has no icon.
final
onSelected → ValueChanged<List<int>>?
Called with the path of the chosen entry, as CNPopupMenuButton.onPathSelected reports it: [2] is items[2], [3, 1] the second entry of the submenu at items[3].
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showsIndicator → bool
Whether the button shows a small arrow (macOS).
final
tooltip → String?
Help text shown when the pointer rests on the button (macOS).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited