Repository: flutter
Issue: Sliver child is created before it is shown in the viewport
Labels: framework,f: scrolling,d: api docs,d: stackoverflow,has reproducible steps,P3,found in release: 3.10,team-framework,triaged-framework,found in release: 3.13

### 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

1. Run the code sample below.
2. Open the DevTools.
    - The bottom of the widget tree in the page shows that CupertinoActivityIndicator already exists although it is far below the viewport.
3. Switch to the Performances tab.
    - The page shows that something is moving constantly.


### Expected results

Widgets are not created until the scroll position comes close to them. In the example code, CupertinoActivityIndicator should not be created and should not animate either too early.

### Actual results

CupertinoActivityIndicator is created when the scroll position is still zero.


### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    const colors = [
      Colors.orange,
      Colors.lightGreen,
      Colors.green,
      Colors.brown,
      Colors.amber,
    ];

    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: CustomScrollView(
            slivers: [
              SliverGrid(
                gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
                  crossAxisCount: 4,
                ),
                delegate: SliverChildBuilderDelegate(
                  childCount: 200,
                  (context, index) => Card(
                    color: colors[index % colors.length],
                    child: Center(
                      child: Text('$index'),
                    ),
                  ),
                ),
              ),
              const SliverToBoxAdapter(
                child: SizedBox(
                  height: 100.0,
                  child: CupertinoActivityIndicator(),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

<img src="https://github.com/flutter/flutter/assets/20254485/a4c7c10b-365b-4227-8bd4-884728c2a800">

</details>


### Logs

_No response_

### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.10.6, on Microsoft Windows [Version 10.0.22621.1992], locale ja-JP)
    • Flutter version 3.10.6 on channel stable at D:\xxxx\flutter\sdk
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (3 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at D:\xxxx\android\sdk
    • Platform android-33, build-tools 33.0.1
    • ANDROID_HOME = D:\xxxx\android\sdk
    • Java binary at: C:\Program Files\JetBrains\IntelliJ IDEA 2021.3.3\jbr\bin\java
    • Java version OpenJDK Runtime Environment JBR-17.0.7+10-829.16-jcef (build 17.0.7+10-b829.16)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.5.33530.505
    • Windows 10 SDK version 10.0.19041.0

[!] 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/windows#android-setup for detailed instructions).

[√] IntelliJ IDEA Ultimate Edition (version 2023.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2021.3.3
    • Flutter plugin version 74.0.4
    • Dart plugin version 231.9392.3

[√] VS Code (version 1.78.2)
    • VS Code at C:\Users\xxxx\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.64.0

[√] Connected device (2 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22621.1992]
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 115.0.1901.188

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.
```

</details>