Repository: flutter
Issue: SliverAppBar gets stuck sometimes while scrolling.
Labels: framework,f: scrolling,has reproducible steps,P2,found in release: 3.7,found in release: 3.10,team-framework,triaged-framework

### 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

Run the sample code I provided on the real device. I tested it on iPhone XR iOS 16. I haven't noticed the issue on the simulator. Also, you can see the issue 0:03 in the video especially watching it slow.


### Expected results

Scrolling the SliverAppBar should be smooth at all times.

When scrolling up the first two times, the SliverAppBar behaves as expected.

### Actual results

From time to time, it freezes and creates really bad experience for the user.

Check the video sample I provide from the code sample. The third time I'm scrolling up [00:03] the SliverAppBar starts correctly — it is shrinking up as the scroll is going up but then suddenly goes back to its original position down and makes an effect of being freezed.

### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const TodayApp());
}

class TodayApp extends StatelessWidget {
  const TodayApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Today',
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatelessWidget {
  const HomeScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: NestedScrollView(
        controller: ScrollController(),
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
          return <Widget>[
            SliverOverlapAbsorber(
              handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
              sliver: const SliverAppBar(
                backgroundColor: Color.fromARGB(255, 255, 0, 0),
                pinned: true,
                snap: false,
                floating: false,
                expandedHeight: 260,
                // flexibleSpace: Placeholder(color: Colors.green),
              ),
            ),
          ];
        },
        body: ListView(children: const [
          SizedBox(height: 80),
          Placeholder(color: Colors.orange),
          Placeholder(color: Colors.blue),
          Placeholder(color: Colors.orange),
        ]),
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>

https://user-images.githubusercontent.com/25743901/232635433-d9cfc4a4-f7ce-4dca-83f5-86237ee9a965.MP4



### Logs

<details><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.7.8, on macOS 13.2.1 22D68 darwin-arm64, locale
    en-MX)
    • Flutter version 3.7.8 on channel stable at /Users/tomas/code/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 90c64ed42b (4 weeks ago), 2023-03-21 11:27:08 -0500
    • Engine revision 9aa7816315
    • Dart version 2.19.5
    • DevTools version 2.20.1

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from:
      https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK
      components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup
      for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.12.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup
      for detailed instructions).

[✓] VS Code (version 1.77.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.62.0

[✓] Connected device (3 available)
    • iPhone 14 Pro Max (mobile) • 5B588A40-8346-4AF6-8CD8-3A54F9EC8C0A • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)            • macos                                •
      darwin-arm64   • macOS 13.2.1 22D68 darwin-arm64
    • Chrome (web)               • chrome                               •
      web-javascript • Google Chrome 112.0.5615.49

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.
```

</details>