Repository navigation
Event funneling #217
Copy link
Copy link
Closed
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
Activity
- addedframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capability
on Nov 9, 2015 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.)
There's several ways we could do this:
- 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.
We're addressing this problem by dedicated widgets, e.g. RadioListTile.
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.- locked as resolved and limited conversation to collaborators
on Aug 17, 2021
Metadata
Metadata
Assignees
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Wednesday Oct 21, 2015 at 23:09 GMT
Originally opened as https://github.com/flutter/engine/issues/1726
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.