Repository: flutter
Issue: VoiceOver reads the items disordered in a scrollable view
Labels: framework,a: accessibility,platform-mac,f: scrolling,has reproducible steps,P2,team-macos,triaged-macos,found in release: 3.27,found in release: 3.28

### Steps to reproduce

1. Run the provided example in macOS
2. Activate VoiceOver
3. Navigate the items with VoiceOver (control + option + right arrow)
4. Notice how the order of the items is not respected

### Expected results

When using VoiceOver in a scrollable view I expect all items to be read in order.

### Actual results

When using VoiceOver in a scrollable view the items are not read in order, some of them even being unreachable.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

void main() {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: List.generate(20, (index) => _Item(index: index)),
          ),
        ),
      ),
    );
  }
}

class _Item extends StatelessWidget {
  const _Item({required this.index});

  final int index;

  @override
  Widget build(BuildContext context) {
    debugDumpSemanticsTree();
    return ColoredBox(
      color: Colors.primaries[index % Colors.primaries.length],
      child: SizedBox.square(
        dimension: 200,
        child: Center(child: Text('Item $index')),
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>


https://github.com/user-attachments/assets/e82bce35-2716-4353-8d7b-229e23dd3f98



</details>


### Logs

<details open><summary>Logs</summary>

```console
flutter: SemanticsNode#0
flutter:  │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0)
flutter:  │
flutter:  └─SemanticsNode#1
flutter:    │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0)
flutter:    │ textDirection: ltr
flutter:    │
flutter:    └─SemanticsNode#2
flutter:      │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0)
flutter:      │ sortKey: OrdinalSortKey#46a7b(order: 0.0)
flutter:      │
flutter:      └─SemanticsNode#3
flutter:        │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0)
flutter:        │ flags: scopesRoute
flutter:        │
flutter:        └─SemanticsNode#4
flutter:          │ Rect.fromLTRB(0.0, 0.0, 800.0, 600.0)
flutter:          │ actions: scrollUp
flutter:          │ flags: hasImplicitScrolling
flutter:          │ scrollExtentMin: 0.0
flutter:          │ scrollPosition: 0.0
flutter:          │ scrollExtentMax: 3400.0
flutter:          │
flutter:          ├─SemanticsNode#5
flutter:          │   Rect.fromLTRB(378.4, 90.0, 421.6, 110.0)
flutter:          │   label: "Item 0"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#6
flutter:          │   Rect.fromLTRB(379.6, 290.0, 420.4, 310.0)
flutter:          │   label: "Item 1"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#7
flutter:          │   Rect.fromLTRB(378.6, 490.0, 421.4, 510.0)
flutter:          │   label: "Item 2"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#8
flutter:          │   Rect.fromLTRB(378.4, 690.0, 421.6, 710.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 3"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#9
flutter:          │   Rect.fromLTRB(378.3, 890.0, 421.7, 910.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 4"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#10
flutter:          │   Rect.fromLTRB(378.5, 1090.0, 421.5, 1110.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 5"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#11
flutter:          │   Rect.fromLTRB(378.4, 1290.0, 421.6, 1310.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 6"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#12
flutter:          │   Rect.fromLTRB(378.8, 1490.0, 421.2, 1510.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 7"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#13
flutter:          │   Rect.fromLTRB(378.4, 1690.0, 421.6, 1710.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 8"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#14
flutter:          │   Rect.fromLTRB(378.4, 1890.0, 421.6, 1910.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 9"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#15
flutter:          │   Rect.fromLTRB(375.0, 2090.0, 425.0, 2110.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 10"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#16
flutter:          │   Rect.fromLTRB(376.2, 2290.0, 423.8, 2310.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 11"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#17
flutter:          │   Rect.fromLTRB(375.2, 2490.0, 424.8, 2510.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 12"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#18
flutter:          │   Rect.fromLTRB(375.1, 2690.0, 424.9, 2710.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 13"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#19
flutter:          │   Rect.fromLTRB(374.9, 2890.0, 425.1, 2910.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 14"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#20
flutter:          │   Rect.fromLTRB(375.1, 3090.0, 424.9, 3110.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 15"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#21
flutter:          │   Rect.fromLTRB(375.0, 3290.0, 425.0, 3310.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 16"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#22
flutter:          │   Rect.fromLTRB(375.5, 3490.0, 424.5, 3510.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 17"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          ├─SemanticsNode#23
flutter:          │   Rect.fromLTRB(375.0, 3690.0, 425.0, 3710.0)
flutter:          │   flags: isHidden
flutter:          │   HIDDEN
flutter:          │   label: "Item 18"
flutter:          │   textDirection: ltr
flutter:          │
flutter:          └─SemanticsNode#24
flutter:              Rect.fromLTRB(375.0, 3890.0, 425.0, 3910.0)
flutter:              flags: isHidden
flutter:              HIDDEN
flutter:              label: "Item 19"
flutter:              textDirection: ltr
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.7.1 23H222 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 16.2)
    ! iOS 18.2 Simulator not installed; this may be necessary for iOS and macOS development.
      To download and install the platform, open Xcode, select Xcode > Settings > Platforms,
      and click the GET button for the required platform.

      For more information, please visit:
        https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.96.0)
[✓] Connected device (4 available)
[✓] Network resources

! Doctor found issues in 1 category.
```

</details>