Repository: flutter
Issue: Add feature to change layout order of slivers
Labels: c: new feature,framework,f: scrolling,d: api docs,P3,team-framework,triaged-framework

### Steps to reproduce

1. Run the example
2. Switch the page from `mainAxisPage` to `pageThroughSlivers`
2.1. hot reload
2.2. observe no changes
3. Switch the page from `pageThroughSlivers` to `pageThroughList`
3.1. hot reload
3.2. observe a different display

### Expected results

I expect all of these examples to produce the same result, but they don't.
The blue box rendered by `mainAxisPage` and `pageThroughSlivers` should be above the brown one like it is for `pageThroughList`.

### Actual results

The actual result is that the brown box is rendered above the blue one for `mainAxisPage` and `pageThroughSlivers`.

It seems, when using slivers that wrap box widgets, the slivers are painted in reverse order.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    const mainAxisPage = MainAxisGroupPage();
    const pageThroughSlivers = PageThroughSlivers();
    const pageThroughList = PageThroughList();

    return const MaterialApp(
      home: mainAxisPage,
    );
  }
}

const _brown = ColoredBox(
  color: Colors.brown,
  child: SizedBox(height: 100),
);
final _blue = Transform.translate(
  offset: const Offset(0, -50),
  child: const ColoredBox(
    color: Color(0xcc0000ff),
    child: SizedBox(height: 100),
  ),
);

class MainAxisGroupPage extends StatelessWidget {
  const MainAxisGroupPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(slivers: [
        SliverMainAxisGroup(slivers: [
          const SliverToBoxAdapter(child: _brown),
          SliverToBoxAdapter(child: _blue),
        ]),
      ]),
    );
  }
}

class PageThroughSlivers extends StatelessWidget {
  const PageThroughSlivers({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(slivers: [
        const SliverToBoxAdapter(child: _brown),
        SliverToBoxAdapter(child: _blue),
      ]),
    );
  }
}

class PageThroughList extends StatelessWidget {
  const PageThroughList({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(slivers: [
        SliverList.list(children: [
          _brown,
          _blue,
        ]),
      ]),
    );
  }
}
```

</details>


### Screenshots or Video

_No response_

### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.19.3, on macOS 14.4 23E214 darwin-arm64, locale en-SI)
    • Flutter version 3.19.3 on channel stable at /Users/.../Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ba39319843 (2 weeks ago), 2024-03-07 15:22:21 -0600
    • Engine revision 2e4ba9c6fb
    • Dart version 3.3.1
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/.../Library/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.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] 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)

[✓] VS Code (version 1.88.0-insider)
    • VS Code at /Applications/Visual Studio Code - Insiders.app/Contents
    • Flutter extension version 3.84.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 14.4 23E214 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 123.0.6312.58

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>