daohoangson / flutter_widget_from_html

Flutter package to render html as widgets that supports hyperlink, image, audio, video, iframe and many other tags.
https://pub.dev/packages/flutter_widget_from_html
MIT License
635 stars 235 forks source link

Compatibility Issue with CachedNetworkImage 3.2.3 due to Deprecated DecoderCallback #1099

Closed AndriiReverchuk closed 5 months ago

AndriiReverchuk commented 11 months ago

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

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.

daohoangson commented 11 months ago

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

AndriiReverchuk commented 11 months ago

@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

daohoangson commented 11 months ago

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.