Repository: flutter
Issue: [Android][PlatformView] ListView contains PlatformView flickers on some touch events
Labels: platform-android,framework,engine,f: scrolling,a: platform-views,c: rendering,has reproducible steps,P2,team-android,triaged-android,found in release: 3.13,found in release: 3.15

### 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. Swipe a ListView containing PlatformView (BannerAd)
2. Let it go to its momentum and watch the scroll animation until PlatformView appears on the screen
3. When PlatformView appears on the screen, tap on PlatformView to just stop scrolling
4. You will notice the flick at the first moment, if you hold down and move your finger a little, the flick will increase, if you just hold the PlatformView and drag the list up and down without clicking the ad, you may observe strange movements

It may be difficult to reproduce or understand the issue exactly as it happened to me, but if you play around with the ListView-PlatformView example I gave, you can generally notice the oddities.

### Expected results

No flick and smooth scrolling animation

### Actual results

I experienced this issue with the `google_mobile_ads` plugin, but since I thought it was related to Android PlatformViews, I decided to create an issue here.

After swiping a `ListView` which contains `PlatformView` (BannerAd) and letting it go to its momentum, when you touch the screen again to stop scrolling, if this touch hits `PlatformView` (BannerAd), the screen flickers, and if you keep touching the screen, it flickers endlessly.

I think there is a problem with the touch event coordinates being passed from the Android platform side to the Flutter side on the TLHC (Texture-layer hybrid composition) PlatformView.
There is another click event issue in the `google_mobile_ads` repo (https://github.com/googleads/googleads-mobile-flutter/issues/608) that may or may not be related to this.

### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

import 'package:google_mobile_ads/google_mobile_ads.dart';

class TestScreen extends StatefulWidget {
  const TestScreen({super.key});

  @override
  State<TestScreen> createState() => _TestScreenState();
}

class _TestScreenState extends State<TestScreen> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView.builder(
        itemCount: 20,
        itemBuilder: (context, index) {
          if (index != 0 && index % 5 == 0) {
            return const BannerExample();
          }

          return AspectRatio(
            aspectRatio: 3 / 2.5,
            child: Container(
              margin: const EdgeInsets.fromLTRB(20, 20, 20, 0),
              color: Colors.primaries[index % Colors.primaries.length],
            ),
          );
        },
      ),
    );
  }
}

class BannerExample extends StatefulWidget {
  const BannerExample({super.key});

  @override
  BannerExampleState createState() => BannerExampleState();
}

class BannerExampleState extends State<BannerExample>
    with AutomaticKeepAliveClientMixin {
  @override
  bool get wantKeepAlive => true;

  BannerAd? _bannerAd;

  @override
  void initState() {
    super.initState();
    _loadAd();
  }

  @override
  Widget build(BuildContext context) {
    super.build(context);

    if (_bannerAd == null) return const SizedBox.shrink();

    return Container(
      width: _bannerAd!.size.width.toDouble(),
      height: _bannerAd!.size.height.toDouble(),
      margin: const EdgeInsets.only(top: 20),
      child: AdWidget(ad: _bannerAd!),
    );
  }

  void _loadAd() async {
    BannerAd(
      adUnitId: 'ca-app-pub-3940256099942544/6300978111', // test id
      request: const AdRequest(),
      size: AdSize.mediumRectangle,
      listener: BannerAdListener(
        onAdLoaded: (ad) => setState(() => _bannerAd = ad as BannerAd),
        onAdFailedToLoad: (ad, _) => ad.dispose(),
      ),
    ).load();
  }

  @override
  void dispose() {
    _bannerAd?.dispose();
    super.dispose();
  }
}

```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

Screen recordings from Samsung A32 physical device (Android 13)

https://github.com/flutter/flutter/assets/64360151/c41d56b2-15ab-4831-a0bf-521996399ea7

https://github.com/flutter/flutter/assets/64360151/ecf05cd3-49cf-4aaf-b649-ce4b2a3f6f53

</details>


### Logs

<details><summary>Logs</summary>

```console
There are no error logs regarding this issue, it's a visual issue
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.13.0, on macOS 11.6 20G165 darwin-x64, locale en-TR)
    • Flutter version 3.13.0 on channel stable
    • Framework revision efbf63d9c6 (6 weeks ago), 2023-08-15 21:05:06 -0500
    • Engine revision 1ac611c64e
    • Dart version 3.1.0
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
```

</details>