MenuItem<T> class

A place in a Menu, or, with children, the title of a submenu.

Like a DropdownItem, an item is data: its words are a String, and T tells one item from another — a route, an id, an enum.

Inheritance

Constructors

Creates a MenuItem.
const

Properties

children → List<MenuEntry<T>>?
The entries of this item's submenu. An item with children is a title: choosing it opens the submenu instead of selecting it.
final
danger → bool
Draws the item in the error colour, for something that destroys.
final
disabled → bool
Greys the item out; it cannot be chosen or opened.
final
extra → Widget?
Something after the words, at the far end of the row: a count, a badge.
final
hashCode → int
The hash code for this object.
no setterinherited
icon → Widget?
An icon before the words. In a collapsed menu it is all that shows.
final
label → String?
The item's words.
final
onTap → VoidCallback?
Called when the item is chosen, beside Menu.onSelect.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → T?
What this item reports through Menu.onSelect, and how the menu tells which item is selected and which submenus are open.
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