Repository: flutter
Issue: Semantics of FadeInImage doesn't show in test
Labels: a: tests,framework,a: accessibility,a: images,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.19,found in release: 3.22

### Steps to reproduce

I'm writing a test for FadeInImage to test for an image semantic. I ran the below widget test code and I'm not getting any semantics. Not sure if it a pumping issue or a semantics tree bug.

### Expected results

Expecting the test to pass and semantic label to appear in the semantics tree

### Actual results

Test fails
```
The following TestFailure was thrown running a test:
Expected: exactly one matching candidate
  Actual: _ElementPredicateWidgetFinder:<Found 0 widgets with element matching predicate: []>
   Which: means none were found but one was expected
```

Also semantics tree doesn't include semantic label

### Code sample

<details open><summary>widget_test.dart</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:transparent_image/transparent_image.dart';
// Using nock as http client
import 'package:nock/nock.dart';

void main() {
  setUpAll(() async {
    nock.init();
  });

  setUp(() {
    nock.cleanAll();
    nock('https://picsum.photos')
        .get('/id/28/200')
        .reply(200, kTransparentImage);
  });

  testWidgets('Test FadeInImage Semantics', (tester) async {
    await tester.pumpWidget(Center(
      child: FadeInImage.memoryNetwork(
        placeholder: kTransparentImage,
        image: 'https://picsum.photos/id/28/200',
        imageSemanticLabel: 'the_photo',
        fadeInDuration: Durations.short1, //50ms
        fadeOutDuration: Durations.short1, //50ms
      ),
    ));

    // Test passes
    expect(find.byType(FadeInImage), findsOneWidget);

    // Tried all those but none worked
    await tester.pump();
    await tester.pumpAndSettle();
    await tester.runAsync(() async {
      await tester.pump(Duration.zero);
      await tester.pump(Durations.short4); //200ms
      await tester.pumpAndSettle();
      await tester.pumpAndSettle(Durations.short4); //200ms
      await Future.delayed(Durations.short4); //200ms
    });

    // Semantics tree doesn't show 'the_photo'
    debugDumpSemanticsTree();

    // Test fails
    expect(find.bySemanticsLabel(RegExp('the_photo')), findsOneWidget);
  });
}

```

</details>


### Screenshots or Video

_No response_

### Logs

<details open><summary>Logs</summary>

```console
SemanticsNode#0
   Rect.fromLTRB(0.0, 0.0, 2400.0, 1800.0)

══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
Expected: exactly one matching candidate
  Actual: _ElementPredicateWidgetFinder:<Found 0 widgets with element matching predicate: []>
   Which: means none were found but one was expected

When the exception was thrown, this was the stack:
#4      main.<anonymous closure> (file:///Users/anasqaderi/Coding/play/flutter_fade_in_image_test/test/widget_5_test.dart:49:5)
<asynchronous suspension>
#5      testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:183:15)
<asynchronous suspension>
#6      TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1017:5)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from package:stack_trace)

This was caught by the test expectation on the following line:
  file:///Users/anasqaderi/Coding/play/flutter_fade_in_image_test/test/widget_5_test.dart line 49
The test description was:
  Test FadeInImage Semantics
════════════════════════════════════════════════════════════════════════════════════════════════════
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-arm64, locale en-AU)
    • Flutter version 3.19.6 on channel stable at /Users/anasqaderi/Coding/exe/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (5 days ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/anasqaderi/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.6+0-17.0.6b829.9-10027231)
    • 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.14.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • 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.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.88.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.86.0

⣻⣻
[✓] Connected device (5 available)            
    • Anas iPhone 15 Pro Max (mobile) • 00008130-001079A10A98001C            • ios            • iOS 17.4.1 21E236
    • Anas iPhone XS Max (mobile)     • 00008020-000E6CCA1104002E            • ios            • iOS 17.4.1 21E236
    • iPhone 15 (mobile)              • 5289200A-DA24-46F5-93CB-B4A7A9C85B6A • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 124.0.6367.62

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>