1. 18 Oct, 2023 1 commit
  2. 12 Oct, 2023 1 commit
    • 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
  3. 14 Aug, 2023 1 commit
  4. 07 Jun, 2023 2 commits
  5. 01 Jun, 2023 1 commit
  6. 04 Apr, 2023 1 commit
  7. 22 Mar, 2023 1 commit
  8. 21 Dec, 2022 1 commit
  9. 29 Nov, 2022 1 commit
    • Greg Spencer's avatar
      Menu bar accelerators (#114852) · 0cb9f704
      Greg Spencer authored
      * Add MenuMenuAcceleratorLabel to support accelerators.
      
      * Review Changes
      
      * Review Changed
      
      * Fix default label builder to use characters
      
      * Remove golden test that shouldn't have been there.
      0cb9f704
  10. 07 Oct, 2022 1 commit
  11. 28 Sep, 2022 1 commit
    • Greg Spencer's avatar
      Implement Material MenuBar and MenuAnchor (#112239) · 8c271e5c
      Greg Spencer authored
      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.
      8c271e5c