MenuItemOptions class
Configuration options for the MenuItemComponent
widget.
Defines the appearance and behavior of a single menu item in a list, typically used within MenuModal or custom menu implementations.
Properties:
icon
: Optional IconData for leading icon (null = no icon displayed)name
: Text label for the menu item (displayed after icon)onPress
: Callback invoked when the menu item is tapped
Common Configurations:
// 1. Menu item with icon
MenuItemOptions(
icon: Icons.settings,
name: "Settings",
onPress: () => openSettings(),
)
// 2. Menu item without icon
MenuItemOptions(
name: "Help & Support",
onPress: () => showHelp(),
)
Constructors
- MenuItemOptions({required String name, required VoidCallback onPress, IconData? icon})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
final
- name → String
-
final
- onPress → VoidCallback
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited