Reputation: 143
I just started using Flutter a couple of days ago and I’m enjoying it a lot.
I noticed that when I use a FlatButton
, onPressed
gets called when the button is touched then released.
Is there a similar widget to FlatButton
that has a callback when it's touched, and perhaps a call back when it is released?
Thanks!
Upvotes: 0
Views: 563
Reputation: 277577
What you are looking for is GestureDetector
GestureDector(
onTapDown: (_) => print('down'),
onTapUp: (_) => print('up'),
child: Text('click me'),
)
Upvotes: 1