onPressed property
void Function()?
onPressed
final
This allows an action to be done by the item. For dropdown menus, this is in addition to the onChange function being called.
Implementation
final void Function()? onPressed;