flutter_widget_from_html icon indicating copy to clipboard operation
flutter_widget_from_html copied to clipboard

Compatibility Issue with CachedNetworkImage 3.2.3 due to Deprecated DecoderCallback

Open AndriiReverchuk opened this issue 2 years ago • 3 comments

Issue Description

While building my Flutter project, I encountered an error related to the cached_network_image package. The error is as follows:

"./../../../.pub-cache/hosted/pub.dev/cached_network_image-3.2.3/lib/src/image_provider/cached_network_image_provider.dart:78:54: Помилка: тип «DecoderCallback» не знайдено . image_provider.CachedNetworkImageProvider ключ, декодування DecoderCallback) { ^^^^^^^^^^^^^^^^"

This seems to be due to the DecoderCallback type being deprecated in Flutter's recent updates (reference: Flutter API Docs).

Package Information

The issue arises when using the flutter_widget_from_html package, which internally relies on fwfh_cached_network_image. The cached_network_image version causing the issue is 3.2.3.

Suggested Solution

Updating the cached_network_image dependency within fwfh_cached_network_image from version 3.2.3 to 3.3.0 or later seems to be a potential solution to this compatibility issue.

Additional Information

  • Flutter version: 3.16.0
  • flutter_widget_from_html version: 0.14.6
  • cached_network_image version: 3.2.3 (causing the issue)

I'm attaching a screenshot of the error for further reference.

screnshot

Looking forward to a resolution or guidance on how to proceed with this. Thank you for your time and efforts in maintaining this package.

AndriiReverchuk avatar Nov 16 '23 22:11 AndriiReverchuk

Can you try running flutter pub upgrade cached_network_image? It should bump that package to 3.3.0 without fix from us.

daohoangson avatar Nov 16 '23 23:11 daohoangson

@daohoangson thank you for your prompt response and suggestion. I appreciate your assistance and the effort you put into maintaining this wonderful package.

I have tried running flutter pub upgrade cached_network_image as you suggested. Unfortunately, this approach did not resolve the issue. In our project, we are using a monorepo setup with Melos, and even attempting to override the cached_network_image dependency in pubspec_overrides did not lead to a successful resolution.

Here's a brief overview of what was attempted:

Ran flutter pub upgrade cached_network_image, which should ideally have upgraded the package to version 3.3.0. Added cached_network_image: ^3.3.0 to pubspec_overrides.yaml in our Melos-managed monorepo setup. Despite these efforts, the compatibility issue with the deprecated DecoderCallback persists. I'm wondering if there might be any other potential solutions or workarounds that we could explore to address this issue.

Once again, thank you for your time and for providing such a valuable

Looking

AndriiReverchuk avatar Nov 17 '23 08:11 AndriiReverchuk

Ah the flutter_blurhash package, which you're currently using, is not yet compatible with Flutter version 3.16. You have two options: either downgrade Flutter to v3.13, or remove the that package from your project. This is no longer related to the flutter_widget_from_html package.

daohoangson avatar Nov 17 '23 08:11 daohoangson