Repository: flutter
Issue: Routing: Ignore focus requests from hidden/obstructed pages
Labels: framework,f: focus,has reproducible steps,P2,found in release: 2.5,found in release: 2.6,team-framework,triaged-framework

When the drawer of a `Scaffold` is open, I'd expect that the `FocusScope` of its body has `canRequestFocus` set to `false` so widgets in its body cannot "steal" focus from the drawer.

Same goes for similar scenarios like when a user navigates from page A to page B and a widget on page A requests focus a bit later and therefore "steals" focus from the current page B. On keyboard-heavy apps (like TV apps), this could happen quite often and can only be avoided by additional checks and `FocusScope`s.

For sake of simplicity, I'll demonstrate only the Scaffold case below:

## Steps to Reproduce

1. Run the sample app below.
2. Use keyboard navigation (Tab) to open the drawer.
3. See that buttons in the drawer have focus. The focus cannot be moved outside the drawer.
4. After 3 seconds, the button in the body of the `Scaffold` gets focused programmaticaly.

**Expected results:** Nothing happens

**Actual results:** The button outside of the drawer gets focused. Pressing Enter activates the button in the `Scaffold`s body. This seems irritating.

https://user-images.githubusercontent.com/5501487/137490123-ce226090-e6d8-4085-9544-d788ad80884f.mp4

<details>
<summary>Code sample</summary>

```dart
import 'dart:async';
import 'dart:developer';

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(
      title: 'Bug Demo',
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  HomePage({Key? key}) : super(key: key);

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final _buttonFocusNode = FocusNode(debugLabel: 'Button');

  Timer? _timer;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      onDrawerChanged: (isOpened) {
        if (isOpened) {
          _timer?.cancel();
          _timer = Timer(const Duration(seconds: 3), () {
            log('Focusing button');
            _buttonFocusNode.requestFocus();
          });
        }
      },
      appBar: AppBar(
        title: const Text('Drawer Demo'),
      ),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            const Text(
                "This button will be focused 3 seconds after opening the drawer:"),
            ElevatedButton(
              focusNode: _buttonFocusNode,
              onPressed: () {},
              child: const Text("Button"),
            )
          ],
        ),
      ),
      drawer: Drawer(
        child: ListView(
          padding: EdgeInsets.zero,
          children: <Widget>[
            ListTile(
              leading: const Icon(Icons.message),
              title: const Text('Messages'),
              onTap: () {},
            ),
            ListTile(
              leading: const Icon(Icons.account_circle),
              title: const Text('Profile'),
              onTap: () {},
            ),
            ListTile(
              leading: const Icon(Icons.settings),
              title: const Text('Settings'),
              onTap: () {},
            ),
          ],
        ),
      ),
    );
  }
}
```

</details>

<details>
  <summary>Flutter Doctor</summary>

```
[✓] Flutter (Channel stable, 2.5.2, on Fedora 34 (Workstation Edition) 5.12.15-300.fc34.x86_64, locale de_DE.UTF-8)
    • Flutter version 2.5.2 at /home/marcus/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 3595343e20 (vor 2 Wochen), 2021-09-30 12:58:18 -0700
    • Engine revision 6ac856380f
    • Dart version 2.14.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/marcus/Android/Sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: /home/marcus/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7678000/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /home/marcus/android-studio
    • Flutter plugin version 54.1.1
    • Dart plugin version 201.9335
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Android Studio (version 2020.3)
    • Android Studio at /home/marcus/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7678000
    • Flutter plugin version 61.2.2
    • Dart plugin version 203.8430
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.60.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.26.0

[✓] Connected device (4 available)
    • Chromecast (mobile)         • 172.20.30.187:5555 • android-arm    • Android 10 (API 29)
    • Chromecast (mobile)         • 172.20.30.59:5555  • android-arm    • Android 10 (API 29)
    • sdk google atv x86 (mobile) • emulator-5554      • android-x86    • Android 10 (API 29) (emulator)
    • Chrome (web)                • chrome             • web-javascript • Google Chrome 91.0.4472.114

• No issues found!
```

</details>