onPressed property

VoidCallback onPressed

Shortcut to the widget's onPressed if it exists, returns a noop otherwise

Implementation

VoidCallback get onPressed => widget.onPressed ?? () {};