onPressed property
void Function()?
onPressed
getter/setter pair
Callback for what should happen when the button is pressed. If you want to interact with onTapUp or onTapCancel it is recommended to extend ButtonComponent.
Implementation
void Function()? onPressed;