Repository: flutter
Issue: [web] [Pointer Interceptor] App crashed on Chrome when closing a dialog containing Pointer Interceptor and Voice over is turn on
Labels: c: crash,a: accessibility,platform-web,package,has reproducible steps,P2,p: pointer_interceptor,team-web,triaged-web,found in release: 3.27,found in release: 3.28

### Steps to reproduce

1. Run the app
2. Turn Voice over on
3. Click to open the dialog
4. Close the dialog from the Enable or Disabled button

### Expected results

Navigated back to initial screen

### Actual results

Crash the app on Chrome with Error code 11

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:pointer_interceptor/pointer_interceptor.dart';

Future<void> main() async =>
    runApp(const ShowDialogExampleApp());

class ShowDialogExampleApp extends StatelessWidget {
  const ShowDialogExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: DialogExample(),
    );
  }
}

class DialogExample extends StatelessWidget {
  const DialogExample({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('showDialog Sample')),
      body: Center(
        child: OutlinedButton(
          onPressed: () => _dialogBuilder(context),
          child: const Text('Open Dialog'),
        ),
      ),
    );
  }

  Future<void> _dialogBuilder(BuildContext context) {
    return showDialog<void>(
      context: context,
      builder: (BuildContext context) {
        return AlertDialog(
          title: const Text('Basic dialog title'),
          content: const Text(
            'A dialog is a type of modal window that\n'
            'appears in front of app content to\n'
            'provide critical information, or prompt\n'
            'for a decision to be made.',
          ),
          actions: <Widget>[
            PointerInterceptor(
              child: TextButton(
                style: TextButton.styleFrom(
                  textStyle: Theme.of(context).textTheme.labelLarge,
                ),
                child: const Text('Disable'),
                onPressed: () {
                  Navigator.of(context).pop();
                },
              ),
            ),
            TextButton(
              style: TextButton.styleFrom(
                textStyle: Theme.of(context).textTheme.labelLarge,
              ),
              child: const Text('Enable'),
              onPressed: () {
                Navigator.of(context).pop();
              },
            ),
          ],
        );
      },
    );
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>
<img width="1840" alt="Screenshot 2024-11-20 at 17 12 26" src="https://github.com/user-attachments/assets/71b54cd7-5816-49d0-880a-202fc3f8126c">
<img width="1840" alt="Screenshot 2024-11-20 at 17 13 11" src="https://github.com/user-attachments/assets/fbe3ce7a-f5e9-4423-a7f0-9481af2c631f">
<img width="1728" alt="Screenshot 2024-11-20 at 17 13 48" src="https://github.com/user-attachments/assets/c483da20-eea3-492f-b00c-3b1bcf1eb9fe">


### Logs

<details open><summary>Logs</summary>

```console
Debug service listening on ws://127.0.0.1:62102/PNkeCMZovkk=/ws
Debug service listening on ws://127.0.0.1:62102/PNkeCMZovkk=/ws
Debugger: Target crashed!
Debugger: Target crashed!
Debugger: Target crashed!
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[Paste your output here]
```

</details>