MenuItem<T> class
A menu item.
T
is the type of MenuItems present in the subMenu.
Can be left off to allow any subtype, or set to NullMenuItem to make
sure there are not subMenus for a given level.
Immutable save for secondary icon visibility.
Add tooltip on menu item
Example code for creating a menu item with tooltip new MenuItem(label, tooltip: tooltip, action:action, icon:icon, subMenu:subMenu);
- Implemented types
- Mixed-in types
- Implementers
Constructors
-
MenuItem(String label, {bool enabled = true, String tooltip = '', ActionWithContext? actionWithContext, Icon? icon, String labelAnnotation = '', Iterable<
String> ? cssClasses, MenuItemAffix? itemSuffix, ObservableList<MenuItemAffix> ? itemSuffixes, MenuModel<T> ? subMenu, String secondaryLabel = '', String? ariaLabel}) -
The constructor for a MenuItem which displays
label
.
Properties
- actionWithContext → ActionWithContext?
-
final
- ariaLabel → String
-
final
-
cssClasses
→ BuiltList<
String> -
Additional CSS classes to be attached to the root menu item element.
final
- enabled ↔ bool
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasIcon → bool
-
no setterinherited
- hasSecondaryLabel → bool
-
no setterinherited
- hasSubMenu → bool
-
no setterinherited
- icon → Icon?
-
final
-
itemSuffixes
→ ObservableList<
MenuItemAffix> -
List of rendered suffixes for this menu item.
final
- label → String
-
final
- labelAnnotation → String
-
A superscript annotation that is shown to the right of the label.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondaryLabel → String
-
final
- showTooltip → bool
-
no setterinherited
-
subMenu
→ MenuModel<
T> -
final
- tooltip → String
-
final
- uiDisplayName → String
-
no setterinherited
- uiIcon → Icon?
-
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited