LunaGao / flag_flutter

flag icons
https://pub.dev/packages/flag
BSD 2-Clause "Simplified" License
63 stars 60 forks source link

Capture from onError ImageCodecException #49

Closed jayeshindianic closed 3 years ago

jayeshindianic commented 3 years ago

This Plugin is not working in flutter web.

[debug] Capture from onError ImageCodecException: Failed to decode image data. Image source: http://localhost:63126/assets/packages/flag/res/flag/fr.svg

LunaGao commented 3 years ago

I got same error in web (debug mode). Would you try web in release mode? It's working in release mode.

I'm still working on this issue, but I have no idea so far.

LunaGao commented 3 years ago

Add --web-renderer html will be successfully showing the image in web.

Example for VS code (launch.json):

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Flutter Web",
            "type": "dart",
            "request": "launch",
            "program": "lib/main.dart",
            "args": ["--web-renderer", "html"]
        }
    ]
}

https://github.com/flutter/flutter/issues/73109 https://flutter.dev/docs/development/tools/web-renderers

Zoudafnan commented 1 year ago

Add --web-renderer html will be successfully showing the image in web.

Example for VS code (launch.json):

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Flutter Web",
            "type": "dart",
            "request": "launch",
            "program": "lib/main.dart",
            "args": ["--web-renderer", "html"]
        }
    ]
}

flutter/flutter#73109 https://flutter.dev/docs/development/tools/web-renderers

DO i have to have the same configurations ?

iugmali commented 11 months ago

I was having the same issue, but when I entered my browser developer tools console, I saw that it failed to load the resource because the server was not providing the image. It worked fine when building for Android.

I hope it helps who is getting into this issue. Go to your browser console and whatever is preventing the image to be loaded may be there.

J0HJOH commented 1 month ago

I was having the same issue, but when I entered my browser developer tools console, I saw that it failed to load the resource because the server was not providing the image. It worked fine when building for Android.

I hope it helps who is getting into this issue. Go to your browser console and whatever is preventing the image to be loaded may be there.

Thank you so much... This helped me alot to know what exactly went wrong and how to fix it.