Repository: flutter
Issue: Image.asset() doesn't load/render image when descendant of disabled TickerMode widget.
Labels: framework,a: assets,a: images,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-framework,triaged-framework

When an `Image.asset()` widget is a descendant of a `TickerMode` widget, the image will not load if the `TickerMode` widget's `enabled` property is set to `false`. Additionally, if the `TickerMode` widget is disabled after the image is loaded, then there is some weird behavior when the app is backgrounded and then brought back into the foreground. This foregrounding behavior is different between iOS and Android.

On iOS, if the `TickerMode.enabled` property is set to `false` after the image has loaded and then you background and foreground the app, the image will disappear. If the `enabled` property is then set to `true`, the image will reload. While the app is in the foreground and the image has been loaded, you can turn the `enabled` property on and off repeatedly without affecting the image. See the attached `iOSBehavior.mp4` video for a demonstration.

On Android, if you set the `enabled` property to `false`, background the app, and then foreground it again, the image will still be visible. However, if you then set the `enabled` property to `true`, the image will flicker as it briefly disappears and reappears. Also, if the `TickerMode.enabled` property is true when the app is backgrounded and foregrounded, and then you set `enabled` to `false`, the image will disappear. Except for the first time after foregrounding, you can enable and disable the `TickerMode` widget without affecting the rendering of the image. See the attached `AndroidBehavior.mp4` video for a demonstration.

## Steps to Reproduce
An example app that demonstrates the problem can be found in this repository:

https://github.com/champeauxr/image_tickermode

The app has an `Image.asset` widget inside a `TickerMode` widget, along with a `Switch` widget (outside the `TickerMode`) that is used to enable/disable the `TickerMode`. The `TickerMode` is initially disabled.

For both iOS and Android:
1. Launch the example app
2. See that the image has not loaded.
3. Turn on the `Switch` widget
4. See that the image has loaded
5. Repeatedly toggle the `Switch` widget
6. See that the image remains visible.

For iOS behavior:
7. After the image is visible, turn the `Switch` widget off.
8. See that the image remains visible
9. Background and foreground the app
10. See that the image has disappeared
11. Turn the `Switch` widget on
12. See that the image has appeared.

For Android Behavior:
7. After the image is visible, turn the `Switch` widget off.
8. See that the image remains visible
9. Background and foreground the app
10. See that the image remains visible
11. Turn the `Switch` widget on.
12. See the image flicker as it briefly disappears and reappears.
13. With the `Switch` widget on, background and foreground the app
14. See that the image remains visible
15. Turn the `Switch` widget off
16. See that the image disappears

<details>
<summary>
Code Example

The following is the app code contained in the example app. Reproducing the issue requires an image asset, so it is recommended to clone the following repository:

https://github.com/champeauxr/image_tickermode

The app has an `Image.asset` widget inside a `TickerMode` widget, along with a `Switch` widget (outside the `TickerMode`) that is used to enable/disable the `TickerMode`. The `TickerMode` is initially disabled.
</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool _tickerEnabled = false;

  void onTickerEnabledChanged(bool value) {
    setState(() {
      _tickerEnabled = value;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          children: [
            TickerMode(
              enabled: _tickerEnabled,
              child: Image.asset('assets/17644.png'),
            ),
            const Text('Image by rawpixel.com on Freepik.com'),
            const SizedBox(height: 32),
            Row(
              children: [
                const Text('Ticker Mode'),
                Switch(value: _tickerEnabled, onChanged: onTickerEnabledChanged)
              ],
            )
          ],
        ),
      ),
    );
  }
}
```
</details>

<details>
  <summary>flutter analyze</summary>

```
flutter analyze
Analyzing image_tickermode...                                           
No issues found! (ran in 2.8s)
```
</details>

<details>
  <summary>flutter doctor -v</summary>

```
flutter doctor -v
[✓] Flutter (Channel stable, 3.3.10, on macOS 12.6.1 21G217 darwin-x64, locale en)
    • Flutter version 3.3.10 on channel stable at /Users/richchampeaux/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (5 weeks ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/richchampeaux/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3
[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.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 11.0.13+0-b1751.21-8125866)
[✓] Connected device (4 available)
    • Pixel 3a (mobile)             • 941AY0HYEJ                               • android-arm64  • Android 12 (API 32)
    • 160-TP iPhone 7 Plus (mobile) • ee2789b3974ca47255609a936e7172e58f01325b • ios            • iOS 14.4.2 18D70
    • macOS (desktop)               • macos                                    • darwin-x64     • macOS 12.6.1 21G217 darwin-x64
    • Chrome (web)                  • chrome                                   • web-javascript • Google Chrome 109.0.5414.87
[✓] HTTP Host Availability
    • All required HTTP hosts are available
• No issues found!
```

</details>

https://user-images.githubusercontent.com/8657174/213237212-ceb5d9d6-81f3-4f34-be2b-7e8b5e71339c.mp4

https://user-images.githubusercontent.com/8657174/213236607-4680dd82-f5a0-4b76-9bff-eb66dfd6a57b.mp4