return GestureDetector(
onTap: () => Navigator.of(context).pop(),
child: GestureDetector(
behavior: HitTestBehavior.translucent, <=== SEE HERE
onTap: () {},
child: child,
),
);
I don't understand the difference between opaque and tanslucent. Based on my code both of them don't work
The
HitTestBehavior.translucentallows you to also trigger the Widget behind your top Z-Index widget. TheHitTestBehavior.opaquewill only trigger the top Z-index widget.Imagine you have a
Stackwith twoGestureDetector. the.opaquewill trigger only the first one and the.translucentwill trigger both.I don't really understand why you need 2
GestureDetectorhere. Maybe try something like this:In your code the 2
GestureDetectorare listening to the same Gesture and only one will trigger the action. Here it's the second one who triggers the actions empty function