Repository: flutter
Issue: Flutter PageView widget flickers when use with Texture widget when scrolling on Android
Labels: platform-android,framework,engine,f: scrolling,a: platform-views,c: rendering,has reproducible steps,P3,team-android,triaged-android,:hourglass_flowing_sand:,found in release: 3.19,found in release: 3.20

### Steps to reproduce

I have a simple PageView widget which has two item(two page).
First page  is a big video player view playing a butterfly.
Second page  is a GridView widget which has four items and its second item is a small video player view playing an another video;

I start scroll pageview from first page to second page, and when the small video player view of second page firstly becomes visible , the screen flickers. After screen capture, I found the flicker: The small video player view's video content appears on the big video player view;

I run the same code on iOS, everything works fine, the flicker does not  happen.


### Expected results

switch between pages should not flicker.

### Actual results

Flicker  happens when scroll to second page

### Code sample

<details open><summary>Code sample</summary>

```dart

import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        
        child: PageView.builder(
          itemCount: 2,
          itemBuilder: (context, index) {
            return index == 0
                ? const VideoPlayerItem('assets/Butterfly-209.mp4')
                : GridView.builder(
                    gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
                      crossAxisCount: 2,
                      childAspectRatio: 9 / 16,
                      crossAxisSpacing: 2.0,
                      mainAxisSpacing: 2.0,
                    ),
                    itemCount: 4,
                    itemBuilder: (BuildContext context, int index) {
                      return [
                        Container(color: Colors.teal[400]),
                        const VideoPlayerItem('assets/hdr10-720p.mp4'),
                        Container(color: Colors.teal[500]),
                        Container(color: Colors.teal[600]),
                      ][index];
                    },
                  );
          },
        ),
      ),
    );
  }
}

class VideoPlayerItem extends StatefulWidget {
  final String asset;

  const VideoPlayerItem(this.asset, {super.key});

  @override
  _VideoPlayerItemState createState() => _VideoPlayerItemState();
}

class _VideoPlayerItemState extends State<VideoPlayerItem> {
  late VideoPlayerController _controller;

  var _inited = false;

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.asset(widget.asset)
      ..initialize()
      ..setLooping(true).then((_) {
        // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
        setState(() {
          _inited = true;
        });
        _controller.play();
      });
  }

  @override
  Widget build(BuildContext context) {
    return _inited ? VideoPlayer(_controller) : Container(color: Colors.black);
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }
}


```

</details>


### Screenshots or Video


[SVID_20240304_172349_1.mp4.zip](https://github.com/flutter/flutter/files/14479360/SVID_20240304_172349_1.mp4.zip)

<img width="453" alt="image" src="https://github.com/flutter/flutter/assets/8973357/86cf32e4-97e5-4d78-b3ca-51ae72da8560">


### Logs

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


### Flutter Doctor output

[✓] Flutter (Channel stable, 3.16.8, on macOS 14.3.1 23D60 darwin-arm64, locale
    zh-Hans-CN)
    • Flutter version 3.16.8 on channel stable at
      /Users/chandarlee/develop/flutter_sdk
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 67457e669f (7 weeks ago), 2024-01-16 16:22:29 -0800
    • Engine revision 6e2ea58a5c
    • Dart version 3.2.5
    • DevTools version 2.28.5

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/chandarlee/develop/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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.7+0-17.0.7b1000.6-10550314)

[✓] IntelliJ IDEA Community Edition (version 2023.3.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 78.1.1
    • Dart plugin version 233.13763.5

[✓] VS Code (version 1.86.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.84.0

[✓] Connected device (5 available)
    • PCLM50 (mobile)   • 35d6b38d                  • android-arm64  • Android
      12 (API 31)
    • TAS AL00 (mobile) • 88Y0219C04005145          • android-arm64  • Android
      12 (API 31)
    • 00008030 (mobile) • 00008020-00091C5C26D2002E • ios            • iOS
      17.3.1 21D61
    • macOS (desktop)   • macos                     • darwin-arm64   • macOS
      14.3.1 23D60 darwin-arm64
    • Chrome (web)      • chrome                    • web-javascript • Google
      Chrome 122.0.6261.94
    ! Error: Browsing on the local area network for 韦良的iPhone. Ensure the device
      is unlocked and attached with a cable or associated with the same local
      area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code
      -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!