PopupMenuOption constructor
Creates a PopupMenuOption.
The onTap
and icon
parameters are required. At least one of
child
or label
must be provided to represent the content of the menu option.
Example:
PopupMenuOption(
icon: Icon(Icons.edit),
label: 'Edit',
onTap: () {
// Handle edit action
},
)
Implementation
PopupMenuOption({
required this.onTap,
required this.icon,
this.child,
this.label,
}) : assert(child != null || label != null, 'child or label is required');