I've been using Flutter for about 8 weeks. It's awesome, no question.
However, there has been something bugging me since I've started, and that is, why do some widgets have an onTap
method whilst others have onPressed
? Google has not been able to give me any answers.
If this is not relevant or on-topic enough for Stack Overflow, sorry about that, please point me to the right community to ask.
In my experience, onTap()
is used for any gesture capture and onPressed()
especially for buttons.
Just like in real life, when you have to use a button, you'll press it.
Hope this will solve your troubles even though I'm not totally sure about that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With