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, @Deprecated('Use ActionWithContext') MenuAction? action, 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
- action ↔ MenuAction?
-
getter/setter pair
- actionWithContext ↔ ActionWithContext?
-
getter/setter pair
- ariaLabel → String?
-
final
-
cssClasses
→ BuiltList<
String> -
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> -
final
- label → String
-
final
- labelAnnotation → String
-
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