• Greg Spencer's avatar
    Allow `TapRegion` to consume tap events (#136305) · 22b0a62a
    Greg Spencer authored
    ## Description
    
    In order for `MenuAnchor` menus to be able to not pass on the taps that close their menus, `TapRegion` needed a way to consume them.  This change adds a flag to the `TapRegion`, `consumeOutsideTap` that will consume taps that occur outside of the region if the flag is set (it is false by default). The same flag is added to `MenuAnchor` to allow selecting the behavior for menus.
    
    `TapRegion` consumes the tap event by registering with the gesture arena and immediately resolving the tap as accepted if any regions in a group have `consumeOutsideTap` set to true.
    
    This PR also deprecates `MenuAnchor.anchorTapClosesMenu`, since it is a much more limited version of the same feature that only applied to the anchor itself, and even then only applied to closing the menu, not passing along the tap.  The same functionality can now be implemented by handling a tap on the anchor widget and checking to see if the menu is open before closing it.
    
    ## Related Issues
     - https://github.com/flutter/flutter/issues/135327
    
    ## Tests
     - Added tests for `TapRegion` to make sure taps are consumed properly.
    22b0a62a
Name
Last commit
Last update
..
animation/curves Loading commit data...
cupertino Loading commit data...
gestures Loading commit data...
material Loading commit data...
painting Loading commit data...
rendering Loading commit data...
sample_templates Loading commit data...
services Loading commit data...
ui/text Loading commit data...
widgets Loading commit data...