flutter/examples
Greg Spencer 22b0a62a0c
Allow TapRegion to consume tap events (#136305)
## 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.
2023-10-12 21:04:41 +00:00
..
api Allow TapRegion to consume tap events (#136305) 2023-10-12 21:04:41 +00:00
flutter_view Allow latest pkg:material_color_utilities (#132445) 2023-10-11 23:57:16 +00:00
hello_world Bump file,process,process_runner (#136418) 2023-10-12 13:05:24 -07:00
image_list Allow latest pkg:material_color_utilities (#132445) 2023-10-11 23:57:16 +00:00
layers Allow latest pkg:material_color_utilities (#132445) 2023-10-11 23:57:16 +00:00
platform_channel Bump file,process,process_runner (#136418) 2023-10-12 13:05:24 -07:00
platform_channel_swift Bump file,process,process_runner (#136418) 2023-10-12 13:05:24 -07:00
platform_view Allow latest pkg:material_color_utilities (#132445) 2023-10-11 23:57:16 +00:00
splash Allow latest pkg:material_color_utilities (#132445) 2023-10-11 23:57:16 +00:00
texture Bump file,process,process_runner (#136418) 2023-10-12 13:05:24 -07:00
.clang-format
flutter_gallery.readme
README.md Fix typo in README.md (#126053) 2023-05-04 14:58:17 +02:00

Flutter Examples

This directory contains several examples of using Flutter. To run an example, use flutter run inside that example's directory. See the getting started guide to install the flutter tool.

For additional samples, see the flutter/samples repo.

Available examples include:

Notes

Note on Gradle wrapper files in .gitignore:

Gradle wrapper files should normally be checked into source control. The example projects don't do that to avoid having several copies of the wrapper binary in the Flutter repo. Instead, the Gradle wrapper is injected by Flutter tooling, and the wrapper files are .gitignore'd to avoid making the Flutter repository dirty as a side effect of running the examples.