onPressed property
void Function()?
onPressed
final
The function that will be called when the button is pressed.
If null, the button will not be clickable and render the disabled sprite, if provided.
Implementation
final void Function()? onPressed;