Repository: flutter
Issue: Android native view scroll flickering using `PlatformViewLink`
Labels: e: device-specific,platform-android,framework,f: scrolling,a: platform-views,P3,team-android,triaged-android

### Steps to reproduce

Embedding a native android view via `AndroidViewSurface` and alternatively `AndroidView`. 

### Expected results

Scrolling is smooth and flicker free. 

### Actual results

When scrolling inside a native android view using `PlatformViewLink` the content starts flickering and sometimes even completely disappears. This is especially noticeable when expanding the keyboard, or slow scrolling.

When using `AndroidView` the scrolling is smooth at any given moment. No flickering is noticeable. No issues with `AndroidView`.

### Code sample

<details open><summary>Code sample</summary>

Implementation via `PlatformViewLink`:
```dart
PlatformViewLink(
          viewType: 'gecko-view',
          surfaceFactory: (
            context,
            controller,
          ) {
            return AndroidViewSurface(
              controller: controller as AndroidViewController,
              gestureRecognizers: const <Factory<
                  OneSequenceGestureRecognizer>>{},
              hitTestBehavior: PlatformViewHitTestBehavior.opaque,
            );
          },
          onCreatePlatformView: (PlatformViewCreationParams params) {
            return PlatformViewsService.initExpensiveAndroidView(
              id: params.id,
              viewType: 'gecko-view',
              layoutDirection: TextDirection.ltr,
              creationParams: {},
              creationParamsCodec: const StandardMessageCodec(),
            )
              ..addOnPlatformViewCreatedListener(params.onPlatformViewCreated)
              ..create();
          },
        ),
```
Implementation via `AndroidView`:
```dart
body: AndroidView(
          viewType: 'gecko-view',
          creationParams: null,
          creationParamsCodec: const StandardMessageCodec(),
          gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},
        ),
```

Complete sample application:
https://github.com/FaFre/geckoview_example

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

Scrolling inside `PlatformViewLink`:
https://github.com/user-attachments/assets/c3bfdf15-763c-498f-b385-333504efb9d4

Scrolling inside `AndroidView`:
https://github.com/user-attachments/assets/9e263c78-2257-4bc2-b1ec-41f1432dd140

</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.24.1, on Manjaro Linux 6.6.46-1-MANJARO, locale en_US.UTF-8)
    • Flutter version 3.24.1 on channel stable at /home/fafre/Software/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5874a72aa4 (8 days ago), 2024-08-20 16:46:00 -0500
    • Engine revision c9b9d5780d
    • Dart version 3.5.1
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /opt/android-sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /opt/android-sdk
    • ANDROID_SDK_ROOT = /opt/android-sdk
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = chromium

[✓] Linux toolchain - develop for Linux desktop
    • clang version 18.1.8
    • cmake version 3.30.2
    • ninja version 1.12.1
    • pkg-config version 2.1.1

[✓] Android Studio (version 2023.3)
    • Android Studio at /opt/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.11+0-17.0.11b1207.24-11852314)

[✓] Connected device (3 available)
    • M2012K11AG (mobile) • 859ef07c • android-arm64  • Android 14 (API 34)
    • Linux (desktop)     • linux    • linux-x64      • Manjaro Linux 6.6.46-1-MANJARO
    • Chrome (web)        • chrome   • web-javascript • Chromium 128.0.6613.84 Arch Linux

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>