• Greg Spencer's avatar
    Fix nested listeners so that ancestor listeners can also receive enter/exit/move events. (#32350) · aeccd6a8
    Greg Spencer authored
    This changes Listener to trigger enter/move/exit in all Listeners below the pointer, not just the leaf region (the first region hit). This is because we need to allow listeners to be nested so that, say, a widget that handles changing color on hover, but also is wrapped in a Tooltip (that handles hover) can trigger both actions, not just one.
    
    To that end, I added a findAll to Layer, similar to the existing find method that was previously used. It returns an iterator over annotated layers which match the given data type.
    
    Since the findAll is implemented as returning an Iterable (and is sync*), I re-implemented the find routines as just returning the first result from findAll, since that should be just as efficient, and would then prevent duplication in the implementation.
    aeccd6a8
mouse_tracking_test.dart 14 KB