4

I need a little help there.

I want to disconnect the user from the app when he has been inactive for 5 minutes. So I used this solution : Detect when user is not interacting the app in Flutter

It is perfectly working when the user tap on a widget that is not clickable. For example, when I tap on Text widget, the timer is restarting without an issue, but when I tap on a RaisedButton or ListTile, the timer is not restarting.

So, I'm wondering how it is possible for example with this code :

GestureDetector(
  onTap: () => print("gestureDetector"),
  child: RaisedButton(
    onPressed: () => print("raisedButton"),
  ),
),

to print "gestureDetector" AND "raisedButton".

Thank you in advance for your help, cheers ;)

NqbraL
  • 553
  • 4
  • 8
  • Btw, I've tried to use IgnorePointer widget or the behavior property of GestureDetector : not working :'( – NqbraL Nov 27 '19 at 10:14

1 Answers1

14

Use a Listener instead of GestureDetector.

Listener(
  onPointerDown: (e) => print('listener'),
  child: RaisedButton(
    onPressed: () => print('raisedButton'),
  ),
),
David L.
  • 762
  • 4
  • 7