onPressed property
Callback invoked when the button is pressed.
This function is executed when the user taps the button. If the menu parameter is provided and contains items, the onPressed callback is overridden, and a DropdownMenu is displayed instead using showDropdown. For standard button behavior without a menu, provide a simple action like navigating to a new screen or triggering a dialog.
Implementation
final VoidCallback? onPressed;