onPressed property

VoidCallback? onPressed
final

if the child builder you must use this when the widget tapped or pressed in order to do what it expected to do

Implementation

final VoidCallback? onPressed;