flutter/examples
Greg Spencer 8c271e5cb8
Implement Material MenuBar and MenuAnchor (#112239)
This implements a MenuBar widget that can render a Material menu bar, and a MenuAnchor widget used to create a cascading menu in a region. The menus are drawn in the overlay, while the menu bar itself is in the regular widget tree. Keyboard traversal works between the two.

This implementation of the MenuBar uses MenuAnchor to create a cascading menu that contains widgets representing the menu items. These menu items can be any kind of widget, but are typically SubmenuButtons that host submenus, or MenuItemButtons that have shortcut hints (but don't actually activate the shortcuts) and don't host submenus.

Cascading menus can be created outside of a MenuBar by using a MenuAnchor. They can be either given a specific location to appear (a coordinate), or they can be located by the MenuAnchor region that wraps the control that opens them.

The developer may also create a MenuController to pass to the various menu primitives (MenuBar or MenuAnchor) to associate menus so that they can be traversed together and closed together. Creating a controller is not required.
2022-09-28 14:10:18 -07:00
..
api Implement Material MenuBar and MenuAnchor (#112239) 2022-09-28 14:10:18 -07:00
flutter_view Revert "Migrate package/flutter to JS static interop. (#111315)" (#112247) 2022-09-23 04:00:22 +00:00
hello_world Roll pub packages (#112408) 2022-09-26 21:21:58 +00:00
image_list Revert "Migrate package/flutter to JS static interop. (#111315)" (#112247) 2022-09-23 04:00:22 +00:00
layers Revert "Migrate package/flutter to JS static interop. (#111315)" (#112247) 2022-09-23 04:00:22 +00:00
platform_channel Roll pub packages (#112408) 2022-09-26 21:21:58 +00:00
platform_channel_swift Roll pub packages (#112408) 2022-09-26 21:21:58 +00:00
platform_view Revert "Migrate package/flutter to JS static interop. (#111315)" (#112247) 2022-09-23 04:00:22 +00:00
splash Revert "Migrate package/flutter to JS static interop. (#111315)" (#112247) 2022-09-23 04:00:22 +00:00
flutter_gallery.readme Move flutter_gallery to the testing folder (#52532) 2020-03-16 10:31:42 +01:00
README.md Move flutter_gallery to the testing folder (#52532) 2020-03-16 10:31:42 +01: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.