Skip to content

Gifs stopped animating in Flutter 3.27.2 and dart 3.6.1 #1003

Open
@Haris2v

Description

@Haris2v

🐛 Bug Report

I tried Flutter SDK 3.27.2 and dart 3.6.1 and found that gifs stopped animations and being displayed as static images on the Flutter web.

Reproduction steps

Set your dart version to 3.6.1 , import cached_network_image: 3.4.1 and run the following code on flutter web.

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

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: GifDisplayScreen(),
      debugShowCheckedModeBanner: false,
    );
  }
}

class GifDisplayScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('GIF Display'),
      ),
      body: Center(
        child: Column(
          children: [
            CachedNetworkImage(
              imageUrl: 'https://i.giphy.com/media/lJ98Us9hMJU5dHANtk/200.gif',
              placeholder: (context, url) => const CircularProgressIndicator(),
              errorWidget: (context, url, error) => const Icon(Icons.error),
            ),
          ],
        ),
      ),
    );
  }
}

Expected behavior

Run the same above code using the 3.24.1 and its working fine. It should work the same way.

Flutter Doctor

[✓] Flutter (Channel stable, 3.27.2, on macOS 14.5 23F79 darwin-arm64 (Rosetta), locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/to/macos-android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.96.1)
[✓] Connected device (4 available)
[✓] Network resources

Platform:

  • Web

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions