Repository navigation
[Google3 Bug]: ImageStream & ImageProvider provide no way to pause GIF animations #175516
Copy link
Copy link
Closed
Closed
Copy link
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: animationAnimation APIsAnimation APIsa: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: chalk (g3)customer: googleVarious Google teamsVarious Google teamsframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework teamworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issue
Description
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
- Load a GIF asset into
ImageProvider/ImageStreamviaCachedNetworkImage.
Expected results
Either one of the following:
- The
ImageProvider/ImageStreamlibrary provides a way to disable any animation of the provided image. MediaQuery.of(context).disableAnimationsis respected by theImageProvider/ImageStreamlibrary by default.
Actual results
- Neither
ImageProvider/ImageStreamprovide a way to disable animation of an image MediaQuery.of(context).disableAnimationsis not respected by theImageProvider/ImageStreamlibrary.
Code sample
Code sample
yaml:
dependencies:
flutter:
sdk: flutter
cached_network_image: ^3.3.1 # Use the latest versionDart 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]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: animationAnimation APIsAnimation APIsa: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttercustomer: chalk (g3)customer: googleVarious Google teamsVarious Google teamsframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework teamworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issue
Type
Projects
- StatusShow more project fieldsDone
Activity
evantea commentedon Sep 17, 2025
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
MultiFrameImageStreamCompleterthat 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.darshankawar commentedon Sep 18, 2025
Thanks for the report. Since you are using cached_network_image library which is third party, a related issue is open in it.
I'll label this as a proposal in the framework and for team's tracking.
evantea commentedon Sep 18, 2025
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?
darshankawar commentedon Sep 19, 2025
This will depend on the priority it'll receive.
You may raise PR for this to get framework team's feedback.
13 remaining items
justinmc commentedon Oct 2, 2025
Here's a much simpler workaround:
This is probably the canonical way to pause a gif. It's pretty explicitly built into Image:
flutter/packages/flutter/lib/src/widgets/image.dart
Lines 1126 to 1130 in d938e30
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 .
zanderso commentedon Oct 2, 2025
@justinmc Should we consider any change in the framework that would make animated gifs/pngs respect
MediaQuery.of(context).disableAnimations?justinmc commentedon Oct 2, 2025
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.
evantea commentedon Oct 2, 2025
Discussed offline with @justinmc, if we use
TickerModeall animations are disabled, which is a good and bad thing.The bad: in our case it breaks
FadeInImageand just makesImagesin our app only show the providedPlaceholderImage.Image GIF pausing (#176492)
Image GIF pausing (flutter#176492)
github-actions commentedon Nov 28, 2025
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 -vand a minimal reproduction of the issue.Image GIF pausing (flutter#176492)
Image GIF pausing (flutter#176492)
Image GIF pausing (#176492)