Repository: flutter
Issue: Semantics focus moves from focused element 
Labels: platform-ios,framework,f: material design,a: accessibility,has reproducible steps,found in release: 2.8,found in release: 2.9,customer: flex,team-design,triaged-design

<!-- 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
-->

## Steps to Reproduce
<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

Preconditions:
VoiceOver feature is ON (Device Settings > Accessibility > VoiceOver)

1. Execute `flutter run` on the code sample <!-- (see "Code sample" section below) -->
2. Tap "Text Button 1"
3. Tap "Text Button 2"
4. Observe which button is selected 

**Expected results:** "Text Button 2" has the semantics focus

**Actual results:** "Text Button 1" has the semantics focus


https://user-images.githubusercontent.com/19349394/150442450-285c7bbd-ba49-410e-9ede-a11a1fe4dd24.MP4



<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';

Future<void> main() async {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool showExtraButton = false;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: [
            Semantics(
              container: true,
              child: GestureDetector(
                onTap: () {
                  setState(() {
                    showExtraButton = !showExtraButton;
                  });
                },
                child: const Text('Text Button 1'),
              ),
            ),
            if (showExtraButton)
              Semantics(
                container: true,
                child: const Text('Text Button 2'),
              ),
          ],
        ),
      ),
    );
  }
}
```

</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.
-->

```
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
```

</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.
-->