yekeskin / flutter_avif

A flutter plugin to view and encode avif images.
https://pub.dev/packages/flutter_avif
MIT License
61 stars 17 forks source link

Not working on Web #46

Closed zhalil closed 7 months ago

zhalil commented 7 months ago

hi, support is stated in the web version, but when I try to open it on the web I get an error stating that the platform is not supported image

yekeskin commented 7 months ago

Can you share a little bit more details like which browser you are using, what version of flutter_avif you are using.

zhalil commented 7 months ago

Can you share a little bit more details like which browser you are using, what version of flutter_avif you are using.

  1. chrome version - 124
  2. flutter_avif - ^2.3.0
  3. Flutter version - 3.19.6
zhalil commented 7 months ago

Same situation in firefox

yekeskin commented 7 months ago

I was able to reproduce the error with AvifImage.network. Other sources seems to work fine. I believe it is related to the http client I am using. Can you try the fix_web_http_client branch to see if it solves the problem?

zhalil commented 7 months ago

I was able to reproduce the error with AvifImage.network. Other sources seems to work fine. I believe it is related to the http client I am using. Can you try the fix_web_http_client branch to see if it solves the problem?

I tried to get the branch via git using pub flutter_avif: git: url: https://github.com/yekeskin/flutter_avif ref: fix_web_http_client

but I get an error after receiving the package with Git: Could not find a file named "pubspec.yaml" in https://github.com/yekeskin/flutter_avif 5554e53c09168e1c342e116958a2c46deaf4d345.

zhalil commented 7 months ago

I was able to reproduce the error with AvifImage.network. Other sources seems to work fine. I believe it is related to the http client I am using. Can you try the fix_web_http_client branch to see if it solves the problem?

I tried to simply replace the file in the existing library, and yes it works, when can I wait in the release build? thank you very much for the fast and efficient work done

yekeskin commented 7 months ago

I am planning to publish an update next week. While waiting for the update, you can pull the plugin directly from git by updating your pubspec.yaml like this:

dependencies:
  flutter_avif:
    git:
      url: https://github.com/yekeskin/flutter_avif.git
      ref: fix_web_http_client
      path: flutter_avif