Repository: flutter
Issue: [webview_flutter] Physical keyboard focus bug
Labels: a: text input,platform-android,p: webview,package,P2,team-android,triaged-android

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

1. Run Android 13 emulator.
2. Turn "Show virtual keyboard" off in "Physical keyboard" settings.
3. Run the code example below. It contains both TextField and webview input form.
4. Type something in the TextField widget (using physical keyboard).
5. Tap to the input form and try to type something.


### Expected results

Webview input works the same as TextField.

### Actual results

It's impossible to enter any text into the input form.

### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  late final WebViewController _controller;

  @override
  void initState() {
    super.initState();

    var controller = WebViewController()
      ..setJavaScriptMode(JavaScriptMode.unrestricted)
      ..setBackgroundColor(const Color(0x00000000))
      ..loadHtmlString('''<html lang="en">
  <head>
    <meta charset="UTF-8">
  </head>
  <body>
    <form>
      <input type="text">
    </form>
  </body>
</html>''');

    _controller = controller;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const TextField(),
      ),
      body: WebViewWidget(controller: _controller),
    );
  }
}
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.10.2, on Linux Mint 21.1 5.15.0-76-generic, locale en_GB.UTF-8)
    • Flutter version 3.10.2 on channel stable at /home/aleksei/flutter_sdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9cd3d0d9ff (7 weeks ago), 2023-05-23 20:57:28 -0700
    • Engine revision 90fa3ae28f
    • Dart version 3.0.2
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /home/aleksei/Android/Sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /usr/local/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2022.2)
    • Android Studio at /usr/local/android-studio
    • 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 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.80.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.68.0

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • Linux Mint 21.1 5.15.0-76-generic

[✓] Network resources
    • All expected network resources are available.
```

</details>