Repository: flutter
Issue: Frozen Scroll and Unresponsive Behavior with NeverScrollableScrollPhysics in NestedScrollView
Labels: framework,waiting for PR to land (fixed),f: scrolling,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.22,found in release: 3.23

### Steps to reproduce

When the physics property of a NestedScrollView is set to NeverScrollableScrollPhysics and the height of the body exactly matches the height of the viewport, scrolling becomes stuck and unresponsive, with no way to recover.

### Expected results

The height is sufficient, scrolling is possible without any freezing or unresponsiveness.  
The height is insufficient, scrolling is disabled and unable to be initiated.

### Actual results

scrolling becomes stuck and unresponsive, with no way to recover.

### 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 const MaterialApp(
      home: NestedScrollViewExample(),
    );
  }
}

class NestedScrollViewExample extends StatelessWidget {
  const NestedScrollViewExample({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: NestedScrollView(
        physics: const NeverScrollableScrollPhysics(),
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
          return <Widget>[
            SliverAppBar(
              expandedHeight: 200.0,
              pinned: true,
              stretch: true,
              backgroundColor: Colors.green,
              flexibleSpace: FlexibleSpaceBar(
                title: const Text('NestedScrollView Example'),
                background: Image.network(
                  'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg',
                  fit: BoxFit.cover,
                ),
              ),
            ),
          ];
        },
        body: ListView.builder(
          physics: const ClampingScrollPhysics(),
          itemCount: 13,
          itemBuilder: (BuildContext context, int index) {
            return ListTile(
              title: Text('Item $index'),
            );
          },
        ),
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

https://github.com/flutter/flutter/assets/33643378/3e813da5-0e0f-4865-8afa-703855d75b22



</details>


### Logs

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


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel master, 3.23.0-13.0.pre.278, on macOS 14.5 23F79 darwin-arm64, locale zh-Hans-CN)
    ! Warning: `flutter` on your path resolves to /Users/*/bin/flutter, which is not inside your current Flutter SDK checkout at
      /Users/*/flutter. Consider adding /Users/*/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/*/bin/dart, which is not inside your current Flutter SDK checkout at /Users/*
      Consider adding /Users/*flutter/bin to the front of your path.
    ! Upstream repository https://*/flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to https://*/flutter.git to dismiss this error.
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.90.1)
[✓] Connected device (6 available)            
    ! Error: Browsing on the local area network for com. 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
```

</details>