You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I add a single event handling child to a larger container that just adds some decoration, sometimes I'd like to be able to say that events that occur within the container should be delivered to the event handling child. As if they'd actually targeted the child.
For example: put a button inside a container that adds some padding and a border. It would be nice if it were possible to funnel gestures that landed outside the button but within the container, to the button. So that the entire thing acted like the button.
Comment by krisgiesing Tuesday Nov 03, 2015 at 21:31 GMT
I think this would only matter if the child is stateful. If it's stateless, the parent can just wrap the whole container in a GestureRecognizer and ignore the callback parameter to the child. (It does somewhat undermine the utility of the callback, though.)
at the rendering layer, we could have a renderbox which in its handleEvent method visited children recursively (asserting if it hit a node with multiple children) until it found a RenderPointerListener descendant, and just proxied the results to that object.
at the widget layer, we could do something similar with a widget that had a Listener, and onPointerDown hunted for a GestureDetector and forwarded pointer down to that object's _handlePointerDown method. Or alternatively, forwarded events from its Listener to a descendant Listener's callbacks.
at the widget layer, we could have a method which did either of those options but using a GlobalKey instead of a walk.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
FlutterIssues commentedon Nov 9, 2015
Tuesday Nov 03, 2015 at 21:31 GMT
I think this would only matter if the child is stateful. If it's stateless, the parent can just wrap the whole container in a GestureRecognizer and ignore the callback parameter to the child. (It does somewhat undermine the utility of the callback, though.)
Hixie commentedon Dec 16, 2015
There's several ways we could do this:
Hixie commentedon Jun 6, 2017
We're addressing this problem by dedicated widgets, e.g. RadioListTile.
github-actions commentedon Aug 17, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.