Repository: flutter
Issue: Refresh Indicator is not called in tests when ListView has controller.
Labels: a: tests,framework,f: scrolling,has reproducible steps,P3,team-design,triaged-design,found in release: 3.21

### Steps to reproduce

1. Run test.
2. It prints nothing.
3. Comment `controller: ScrollController()`.
4. Run test.
5. It prints `test`.

### Expected results

Prints `test` twice.

### Actual results

Prints `test` only in second case.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  testWidgets("test", (tester) async {
    await tester.pumpWidget(MaterialApp(
      title: 'Flutter Demo',
      home: Scaffold(
        body: RefreshIndicator(
          onRefresh: () async {
            print("test");
          },
          child: ListView(
            controller: ScrollController(),
            children: List.filled(30, Text("test")),
          ),
        ),
      ),
    ));

    await tester.fling(find.text("test").first, const Offset(0, 400), 100);
    await tester.pumpAndSettle();
  });
}

```

</details>


### Screenshots or Video

_No response_

### Logs

_No response_

### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.19.3, on Microsoft Windows [Version 10.0.19045.4170], locale pl-PL)
    • Flutter version 3.19.3 on channel stable at C:\Users\kkras\fvm\versions\3.19.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ba39319843 (3 weeks ago), 2024-03-07 15:22:21 -0600
    • Engine revision 2e4ba9c6fb
    • Dart version 3.3.1
    • DevTools version 2.31.1

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\kkras\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = C:\Users\kkras\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
    • All Android licenses accepted.

[✗] 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 Windows apps
    ✗ Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[✓] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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.9+0--11185874)

[✓] VS Code (version 1.87.2)
    • VS Code at C:\Users\kkras\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.82.0

[✓] Connected device (3 available)
    • Android SDK built for x86 64 (mobile) • emulator-5554 • android-x64    • Android 8.0.0 (API 26) (emulator)
    • Windows (desktop)                     • windows       • windows-x64    • Microsoft Windows [Version
      10.0.19045.4170]
    • Edge (web)                            • edge          • web-javascript • Microsoft Edge 122.0.2365.92

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.
```

</details>