Reputation: 402
I have a container with a column as child and stack as immediate parent. onTap method only works when I press the Text widgets rendered inside the column widget and not the blank space of the container.
Upvotes: 3
Views: 196
Reputation: 12629
The default behavior of the GestureDetector
is to react only on rendered content and let the press bubble up instead, if it can't find a child rendered in that position. You can, however, change the behavior of the GestureDetector
to always report a hit, no matter you press in a rendered child or not:
// On GestureDetector:
behavior: HitTestBehavior.translucent,
Upvotes: 0