Repository: flutter
Issue: [material/menu_anchor.dart] Directional focus causes strange focus order with overlapping menus.
Labels: framework,f: material design,has reproducible steps,P2,team-design,triaged-design,found in release: 3.19,found in release: 3.20

### Steps to reproduce

1. Run code sample
2. Make your screen small enough so that submenus overlap when opened (see video)
3. Move focus using only the down arrow 

### Expected results

Focus should move from the first item to the last item, without focusing any submenu items.

### Actual results

Focus moves to submenus that overlap the root menu, and submenu items are skipped (presumably because skipped menu items are above the SubmenuButton). 

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() => runApp(const MenuApp());

class MenuApp extends StatelessWidget {
  const MenuApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(body: MyCascadingMenu()),
    );
  }
}

class MyCascadingMenu extends StatefulWidget {
  const MyCascadingMenu({super.key});

  @override
  State<MyCascadingMenu> createState() => _MyCascadingMenuState();
}

class _MyCascadingMenuState extends State<MyCascadingMenu> {
  final FocusNode _buttonFocusNode = FocusNode();

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        MenuAnchor(
          childFocusNode: _buttonFocusNode,
          menuChildren: <Widget>[
            MenuItemButton(
                onPressed: () {},
                child: const Text('1...........................')),
            MenuItemButton(onPressed: () {}, child: const Text('2')),
            SubmenuButton(
              menuChildren: <Widget>[
                MenuItemButton(onPressed: () {}, child: const Text('3-1')),
                SubmenuButton(
                  menuChildren: <Widget>[
                    MenuItemButton(
                        onPressed: () {}, child: const Text('3-2-1')),
                    MenuItemButton(
                        onPressed: () {}, child: const Text('3-2-2')),
                  ],
                  child: const Text('3-2...........................'),
                ),
                MenuItemButton(onPressed: () {}, child: const Text('3-3')),
              ],
              child: const Text('3...........................'),
            ),
            SubmenuButton(
              menuChildren: <Widget>[
                MenuItemButton(onPressed: () {}, child: const Text('4-1')),
                MenuItemButton(onPressed: () {}, child: const Text('4-2')),
              ],
              child: const Text('4...........................'),
            ),
            MenuItemButton(onPressed: () {}, child: const Text('5')),
            MenuItemButton(onPressed: () {}, child: const Text('6')),
          ],
          builder: (
            BuildContext context,
            MenuController controller,
            Widget? child,
          ) {
            return TextButton(
              focusNode: _buttonFocusNode,
              onPressed: () {
                if (controller.isOpen) {
                  controller.close();
                } else {
                  controller.open();
                }
              },
              child: const Text('OPEN MENU'),
            );
          },
        ),
      ],
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

During the parts where focus is slowly moving, I'm only hitting the down arrow.

https://github.com/flutter/flutter/assets/59215665/92a136a6-09f2-401e-acb6-fc8074a562d0

For comparison, this is the menu from Angular Material

https://github.com/flutter/flutter/assets/59215665/ffef6603-ca3d-47fd-add5-52b3bf147036



</details>


### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel master, 3.19.0-2.0.pre.14, on macOS 14.0 23A344 darwin-arm64, locale en-US)
    • Flutter version 3.19.0-2.0.pre.14 on channel master at /Users/davidhicks/fvm/versions/master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 29db9dbd44 (7 weeks ago), 2024-01-08 23:24:31 -0500
    • Engine revision 820645dbcc
    • Dart version 3.4.0 (build 3.4.0-4.0.dev)
    • DevTools version 2.31.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/davidhicks/Library/Android/sdk
    • Platform android-34, build-tools 33.0.0
    • ANDROID_HOME = /Users/davidhicks/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.86.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.83.20240201

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 14.0 23A344 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 122.0.6261.69
    ! Error: Browsing on the local area network for David’s iPhone. Ensure the device is unlocked and attached with a
      cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>