Repository: flutter
Issue: `floating` behavior of `SliverPersistentHeader` does not match that of `SliverAppBar`
Labels: framework,f: scrolling,has reproducible steps,P2,found in release: 3.10,found in release: 3.12,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

I have a `CustomScrollView` consisting of the following slivers:
* a `SliverAppBar` ("the app bar"), with: `floating: true, pinned: false, snap: false`
* a `SliverPersistentHeader` ("the header"), with `floating: true, pinned: false`
* a `SliverList` ("the list") of page content.

If I scroll partway down the list, so that the app bar and header disappear, then immediately when I start scrolling up, the app bar appears. However, the header does not appear until I scroll all the way up to the top of the list.

I think this is a bug in `SliverPersistentHeader`, since `floating: true` should (as I understand it) cause the header to appear with the same semantics as when `SliverAppBar` has the same setting.

### Expected results

`floating: true` should cause the header to appear as soon as I start scrolling up, not when I get to the top of the list.

See video recording below.

### Actual results

`SliverAppBar` and `SliverPersistentHeader` should have same `floating` and `pinned` semantics.

### Code sample

<details><summary>Code sample</summary>

```dart
class _HeaderDelegate extends SliverPersistentHeaderDelegate {
  final double height;

  _HeaderDelegate({
    required this.height,
  });

  @override
  double get maxExtent => height;

  @override
  double get minExtent => 0.0;

  @override
  bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) {
    return true;
  }

  @override
  Widget build(
          BuildContext context, double shrinkOffset, bool overlapsContent) =>
      SingleChildScrollView(
        child: Container(
          color: Colors.amber,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(onPressed: () {}, child: const Text('Click me')),
            ],
          ),
        ),
      );
}

class SliverPage extends StatelessWidget {
  const SliverPage({super.key});

  @override
  Widget build(BuildContext context) {
    return CustomScrollView(
      slivers: <Widget>[
        const SliverAppBar(
          expandedHeight: 100,
          title: Text('Title text'),
          floating: true,                    // (*)
          pinned: false,
          snap: false,
          backgroundColor: Colors.amber,
          // Make the hamburger menu icon white
          iconTheme: IconThemeData(color: Colors.white),
        ),
        SliverPersistentHeader(
          delegate: _HeaderDelegate(height: 48),
          floating: true,                   // (*)
          pinned: false,
        ),
        SliverList(
          delegate: SliverChildBuilderDelegate(
            (_, int index) {
              return ListTile(
                leading: Container(
                  padding: const EdgeInsets.all(8),
                  width: 100,
                  child: const Placeholder(),
                ),
                title: Text('Place ${index + 1}', textScaleFactor: 2),
              );
            },
            childCount: 20,
          ),
        ),
      ],
    );
  }
}

void main() {
  runApp(
    const MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: SliverPage(),
        ),
      ),
    ),
  );
}
```
</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

https://github.com/flutter/flutter/assets/811305/b29a11dc-7cfb-40ab-b235-2cbdbf945f8c

</details>


### Logs

_No response_

### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.10.5, on Fedora Linux 38 (Workstation Edition) 6.3.6-200.fc38.x86_64, locale en_US.utf8)
    • Flutter version 3.10.5 on channel stable at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (2 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /home/luke/Android/Sdk
    • Platform android-UpsideDownCake, build-tools 33.0.1
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 16.0.5 (Fedora 16.0.5-1.fc38)
    • cmake version 3.26.4
    • ninja version 1.11.1
    • pkg-config version 1.8.0

[✓] Android Studio (version 2022.2)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 73.0.2
    • Dart plugin version 222.4582
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.79.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.66.0

[✓] Connected device (3 available)
    • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • Linux (desktop)            • linux         • linux-x64      • Fedora Linux 38 (Workstation Edition) 6.3.6-200.fc38.x86_64
    • Chrome (web)               • chrome        • web-javascript • Google Chrome 114.0.5735.106

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>