Skip to content

[Google3 Bug]: ImageStream & ImageProvider provide no way to pause GIF animations #175516

Closed

Description

@evantea

Related: #130976

Help us understand the severity of this issue

  • causing severe production issues e.g. malfunctions or data loss
  • blocking next binary release
  • blocking a client feature launch within a quarter
  • nice-to-have but does not block a launch within the next quarter

Steps to reproduce

  1. Load a GIF asset into ImageProvider/ImageStream via CachedNetworkImage.

Expected results

Either one of the following:

  1. The ImageProvider/ImageStream library provides a way to disable any animation of the provided image.
  2. MediaQuery.of(context).disableAnimations is respected by the ImageProvider/ImageStream library by default.

Actual results

  1. Neither ImageProvider/ImageStream provide a way to disable animation of an image
  2. MediaQuery.of(context).disableAnimations is not respected by the ImageProvider/ImageStream library.

Code sample

Code sample

yaml:

dependencies:
  flutter:
    sdk: flutter
  cached_network_image: ^3.3.1 # Use the latest version

Dart File:

import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'GIF Loading with CachedNetworkImage',
      home: Scaffold(
        appBar: AppBar(title: const Text('Cached GIF')),
        body: Center(
          child: CachedNetworkImage(
            imageUrl:
                'https://media1.tenor.com/m/Ps_NnXFTyRYAAAAC/send-link-send.gif',
            placeholder: (context, url) => const CircularProgressIndicator(),
            errorWidget: (context, url, error) => const Icon(Icons.error),
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Activity

  1. evantea commented on Sep 17, 2025

    @evantea
    Author

    This is a feature request/issue that affects the "Chalk" app.

    I was able to put together a local change that piped a new boolean down to MultiFrameImageStreamCompleter that determined whether we should draw past the first frame here. I'm not certain whether this is the preferred approach by the Flutter team, but it did work.

  2. darshankawar commented on Sep 18, 2025

    @darshankawar
    Member

    Thanks for the report. Since you are using cached_network_image library which is third party, a related issue is open in it.

    I was able to put together a local change that piped a new boolean down to MultiFrameImageStreamCompleter that determined whether we should draw past the first frame here. I'm not certain whether this is the preferred approach by the Flutter team, but it did work.

    I'll label this as a proposal in the framework and for team's tracking.

  3. added
    a: imagesLoading, displaying, rendering images
    c: proposalA detailed proposal for a change to Flutter
    c: new featureNothing broken; request for a new capability
    frameworkflutter/packages/flutter repository. See also f: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Sep 18, 2025
  4. evantea commented on Sep 18, 2025

    @evantea
    Author

    Thanks for triaging the issue Darshan, once the framework fix is in I'll do the work to get it implemented in our codebase.

    I was wondering how updates to severity work? This issue will eventually block a binary release, am I supposed to update the initial post when that time comes or should I provide a timeline here?

  5. darshankawar commented on Sep 19, 2025

    @darshankawar
    Member

    I was wondering how updates to severity work? This issue will eventually block a binary release, am I supposed to update the initial post when that time comes or should I provide a timeline here?

    This will depend on the priority it'll receive.

    I was able to put together a local change that piped a new boolean down to MultiFrameImageStreamCompleter that determined whether we should draw past the first frame here. I'm not certain whether this is the preferred approach by the Flutter team, but it did work.

    You may raise PR for this to get framework team's feedback.

  6. 13 remaining items

  7. justinmc commented on Oct 2, 2025

    @justinmc
    Contributor

    Here's a much simpler workaround:

    TickerMode(
      enabled: !_isPaused,
      child: Image(image: myImage),
    ),

    This is probably the canonical way to pause a gif. It's pretty explicitly built into Image:

    if (TickerMode.of(context)) {
    _listenToStream();
    } else {
    _stopListeningToStream(keepStreamAlive: true);
    }

    I will plan to open a PR that explains this in the docs a little bit better and then resolve this issue. Let me know if this does not solve your problem @evantea .

  8. zanderso commented on Oct 2, 2025

    @zanderso
    Member

    @justinmc Should we consider any change in the framework that would make animated gifs/pngs respect MediaQuery.of(context).disableAnimations ?

  9. justinmc commented on Oct 2, 2025

    @justinmc
    Contributor

    Great point, I forgot about that property from above. That would go a long way towards helping our users support accessibility. I'll see if I can wire that up.

  10. evantea commented on Oct 2, 2025

    @evantea
    Author

    Discussed offline with @justinmc, if we use TickerMode all animations are disabled, which is a good and bad thing.

    The bad: in our case it breaks FadeInImage and just makes Images in our app only show the provided PlaceholderImage.

  11. added a commit that references this issue on Nov 13, 2025
  12. added
    r: fixedIssue is closed as already fixed in a newer version
    on Nov 14, 2025
  13. added a commit that references this issue on Nov 22, 2025
  14. github-actions commented on Nov 28, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Nov 28, 2025
  16. added a commit that references this issue on Dec 2, 2025
  17. added a commit that references this issue on Dec 10, 2025
  18. added a commit that references this issue on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: animationAnimation APIsa: imagesLoading, displaying, rendering imagesc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: chalk (g3)customer: googleVarious Google teamsframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework teamworkaround availableThere is a workaround available to overcome the issue

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions