Repository: flutter
Issue: AppBar scrolled under state not working when scrolling is inside PageView
Labels: framework,f: scrolling,has reproducible steps,P2,team-design,triaged-design,found in release: 3.24,found in release: 3.26

### Steps to reproduce

Run the attached code sample

### Expected results

`AppBar` shows elevation when `ListView` content is scrolled

### Actual results

`AppBar` shows no elevation when `ListView` content is scrolled. Instead it works when `ListView` is taken out of the `PageView`.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter issue',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const HomePageView(),
    );
  }
}

class HomePageView extends StatefulWidget {
  const HomePageView({super.key});

  @override
  State<HomePageView> createState() => _HomePageViewState();
}

class _HomePageViewState extends State<HomePageView> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Scrolled under')),
      body: PageView(
        children: [
          _buildLongListPage(),
          _buildLongListPage(),
          _buildLongListPage(),
        ],
      ),
    );
  }

  Widget _buildLongListPage() {
    return ListView(
      children: List.generate(40, (index) {
        return Card(
          child: Padding(
            padding: const EdgeInsets.all(16),
            child: Text('Item $index'),
          ),
        );
      }),
    );
  }
}
```

</details>


### Screenshots or Video

_No response_

### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.24.1, on Microsoft Windows [Versione 10.0.19045.4894], locale it-IT)
    • Flutter version 3.24.1 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5874a72aa4 (5 weeks ago), 2024-08-20 16:46:00 -0500
    • Engine revision c9b9d5780d
    • Dart version 3.5.1
    • DevTools version 2.37.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\Alessandro\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.11.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.11.35312.102
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK

[√] Android Studio (version 2024.1)
    • Android Studio at C:\Program Files\Android\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
    • android-studio-dir = C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)

[√] VS Code (version 1.71.2)
    • VS Code at C:\Users\Alessandro\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.48.0

[√] Connected device (4 available)
    • Pixel Fold (mobile) • 35181FDHS00206 • android-arm64  • Android 14 (API 34)
    • Windows (desktop)   • windows        • windows-x64    • Microsoft Windows [Versione 10.0.19045.4894]
    • Chrome (web)        • chrome         • web-javascript • Google Chrome 128.0.6613.138
    • Edge (web)          • edge           • web-javascript • Microsoft Edge 128.0.2739.42

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
```

</details>