MenuItem class
One entry of a Menu.
label, toolTip, checked and disabled are live: once the menu has
been handed to setContextMenu, assigning them updates the native item, so
menuItem.checked = !menuItem.checked inside onClick is enough.
- Annotations
-
- @Deprecated('The 0.5.x compatible API will be removed in a future release. Use the native API from package:tray_manager/tray_manager.dart.')
Constructors
- MenuItem({String? key, String type = 'normal', String? label, String? sublabel, String? toolTip, String? icon, bool? checked, bool disabled = false, void onClick()?, void onHighlight()?, void onLoseHighlight()?})
- MenuItem.checkbox({String? key, String? label, String? sublabel, String? toolTip, String? icon, required bool? checked, bool disabled = false, void onClick()?, void onHighlight()?, void onLoseHighlight()?})
- MenuItem.separator()
Properties
- checked ↔ bool?
-
getter/setter pair
- disabled ↔ bool
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon ↔ String?
-
An asset name or a file path.
getter/setter pair
- id ↔ int
-
getter/setter pair
- key ↔ String?
-
getter/setter pair
- label ↔ String?
-
getter/setter pair
- onClick ↔ void Function()?
-
getter/setter pair
- onHighlight ↔ void Function()?
-
Never called by the native menu; kept for source compatibility.
getter/setter pair
- onLoseHighlight ↔ void Function()?
-
Never called by the native menu; kept for source compatibility.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sublabel ↔ String?
-
Not shown by the native menu; kept for source compatibility.
getter/setter pair
-
getter/setter pair
- toolTip ↔ String?
-
getter/setter pair
- type ↔ String
-
normal,separator,submenuorcheckbox.getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited