Repository: flutter
Issue: [iOS] VoiceOver does NOT work after a hot-restart on iOS
Labels: platform-ios,engine,a: accessibility,t: hot reload,has reproducible steps,P2,found in release: 3.0,found in release: 3.1,customer: flex,team-ios,triaged-ios

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

Hi Flutter team! As the title says, VoiceOver does not work properly after a hot-restart on iOS. I found the workaround on this bug, which is to just toggle `VoiceOver` once again after a hot-restart, but this is my second time running into iOS hot-restart-related issue and just thought they might be somewhat [related](https://github.com/flutter/flutter/issues/105975).

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Execute `flutter run` on the code sample <!-- (see "Code sample" section below) -->
2. Turn on the VoiceOver on an iOS device <!-- describe steps to demonstrate bug -->
3. Tap/Move your finger around the AppBar and the text in the center to trigger VoiceOver <!-- for example "Tap on X and see a crash" -->
4. VoiceOver is triggered
5. Hot restart
6. Repeat Step 3 and see the behavior

**Expected results:** <!-- what did you want to see? -->

VoiceOver is triggered and texts in the AppBar and body are said aloud.

**Actual results:** <!-- what did you see? -->

VoiceOver cannot find elements inside the app

<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('iOS VoiceOver'),
        ),
        body: const Center(
          child: Text(
            'iOS VoiceOver is NOT working after a hot-restart',
          ),
        ),
      ),
    );
  }
}
```

</details>

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue. If there is a crash, please include
      the entirety of the crash log including the backtrace.
-->

Right after doing a first hot restart, I got these messages:
```
[+1075 ms] [Accessibility] Went all the way up the container chain from @, but could not find any container that was one of the ordered children of @.  This may be acceptable if it happened right
around a layout change, but it would be best to double check by swiping left/right to see if you can get to all elements.
[        ] [Accessibility] Went all the way up the container chain from @, but could not find any container that was one of the ordered children of @.  This may be acceptable if it happened right
around a layout change, but it would be best to double check by swiping left/right to see if you can get to all elements.
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

flutter analyze:

```
Analyzing voice_over_test...                                            
No issues found! (ran in 1.2s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

flutter doctor -v:

```
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5 21G72 darwin-arm, locale en-US)
    • Flutter version 3.0.5 at /Users/heeyunlee/fvm/versions/3.0.5
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (4 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/heeyunlee/Library/Android/sdk
    • Platform android-33, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] 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-7772763)

[✓] VS Code (version 1.70.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.46.0

[✓] Connected device (4 available)
    • Pixel 4a (mobile)        • 0A301JEC212254            • android-arm64  • Android 12 (API 32)
    • Heeyun’s iPhone (mobile) • 00008101-000A48C40251003A • ios            • iOS 15.6 19G71
    • macOS (desktop)          • macos                     • darwin-arm64   • macOS 12.5 21G72 darwin-arm
    • Chrome (web)             • chrome                    • web-javascript • Google Chrome 104.0.5112.79

[✓] HTTP Host Availability
    • All required HTTP hosts are available
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->


https://user-images.githubusercontent.com/32585133/184155406-9455d256-a636-4b96-8022-549aad3997d6.mov