Repository: flutter
Issue: `FocusNode.nextFocus()` doesn't seem to focus the next node
Labels: a: text input,framework,a: desktop,f: focus,has reproducible steps,P3,team-framework,triaged-framework,found in release: 3.13,found in release: 3.17,fyi-text-input

### Steps to reproduce

1. Run `flutter run` on the code sample provided below (might be more relevant on web or desktop to be able to use <kbd>tab</kbd>)
2. Use <kbd>tab</kbd> to traverse the nodes and notice it works as expected.
3. Click on the `skip_next` icon button.

### Expected results

When I click on the `skip_next` icon button, I expect the focus to move to the node after the clicked button
- For the button in the text field 3, I expect the focus to move to the text field 4.
- For the button in the text field 8, I expect the focus to move to the text field 9.


### Actual results

The focus moves to the text field 1

### Code sample

<details><summary>Code sample</summary>

Or you can checkout https://github.com/ValentinVignal/flutter_app_stable/tree/flutter/focus-node/next-focus

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: Row(
          children: [
            Expanded(
              child: FocusTraversalGroup(
                child: Column(
                  children: <Widget>[
                    TextFormField(
                      decoration: const InputDecoration(label: Text('1')),
                    ),
                    TextFormField(
                      decoration: const InputDecoration(label: Text('2')),
                    ),
                    const _Field(
                      decoration: InputDecoration(label: Text('3')),
                    ),
                    TextFormField(
                      decoration: const InputDecoration(label: Text('4')),
                    ),
                    TextFormField(
                      decoration: const InputDecoration(label: Text('5')),
                    ),
                  ],
                ),
              ),
            ),
            const SizedBox(width: 20),
            Expanded(
              child: FocusTraversalGroup(
                child: Column(
                  children: <Widget>[
                    TextFormField(
                      decoration: const InputDecoration(label: Text('6')),
                    ),
                    TextFormField(
                      decoration: const InputDecoration(label: Text('7')),
                    ),
                    const _Field(
                      decoration: InputDecoration(label: Text('8')),
                    ),
                    TextFormField(
                      decoration: const InputDecoration(label: Text('9')),
                    ),
                    TextFormField(
                      decoration: const InputDecoration(label: Text('10')),
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class _Field extends StatefulWidget {
  const _Field({
    this.decoration,
  });

  final InputDecoration? decoration;

  @override
  State<_Field> createState() => __FieldState();
}

class __FieldState extends State<_Field> {
  final focusNodeText = FocusNode();
  final focusNodeButton = FocusNode();

  @override
  void dispose() {
    focusNodeText.dispose();
    focusNodeButton.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return FocusTraversalGroup(
      child: Stack(
        children: [
          TextFormField(
            decoration: widget.decoration,
            focusNode: focusNodeText,
          ),
          Positioned(
            right: 0,
            child: Row(
              mainAxisSize: MainAxisSize.min,
              children: [
                IconButton(
                  focusNode: focusNodeButton,
                  icon: const Icon(Icons.skip_next),
                  onPressed: () {
                    focusNodeButton.nextFocus();
                  },
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

Use of tab (working as expected):


https://github.com/flutter/flutter/assets/32538273/e304f2bb-483e-4d06-8aa0-7d8335cbe47c

Use of the icon button:


https://github.com/flutter/flutter/assets/32538273/cff7bb73-52df-46f7-8934-9dc4ff3234b8



</details>


### Logs

<details><summary>Logs</summary>

```console
Building macOS application...                                           
2023-11-10 14:47:53.008 flutter_app_stable[14119:145765] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
Syncing files to device macOS...                                   165ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on macOS is available at: http://127.0.0.1:57677/k6My6xcvPnQ=/
The Flutter DevTools debugger and profiler on macOS is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:57677/k6My6xcvPnQ=/

Application finished.
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[!] Flutter (Channel stable, 3.13.9, on macOS 14.0 23A344 darwin-x64, locale en-GB)
    • Flutter version 3.13.9 on channel stable at /Users/valentin/flutter/flutter
    ! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/3.1.2/libexec/bin/dart, which is not inside your current Flutter SDK checkout at
      /Users/valentin/flutter/flutter. Consider adding /Users/valentin/flutter/flutter/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d211f42860 (2 weeks ago), 2023-10-25 13:42:25 -0700
    • Engine revision 0545f8705d
    • Dart version 3.1.5
    • DevTools version 2.25.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /usr/local/Caskroom/android-sdk/4333796
    • Platform android-33, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.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 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.84.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.76.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 14.0 23A344 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 119.0.6045.123

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
```

</details>