PopupMenuItem<T> class

A single popup menu item data model used with PopupMenu.

PopupMenuItem(label: 'Edit', icon: Icons.edit, onTap: _edit)

Constructors

PopupMenuItem({required String label, T? value, IconData? icon, Color? color, bool destructive = false, bool enabled = true, bool selected = false, VoidCallback? onTap})
const

Properties

color → Color?
Icon/label color.
final
destructive → bool
Whether the action is destructive.
final
enabled → bool
Whether the item is enabled.
final
hashCode → int
The hash code for this object.
no setterinherited
icon → IconData?
Leading icon.
final
label → String
Item label.
final
onTap → VoidCallback?
Tap callback before selection.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selected → bool
Whether the item is selected (shows a check).
final
value → T?
Item value.
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