Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
803 views
in Technique[技术] by (71.8m points)

Flutter web Image loading in mobile view, but not in full view?

I am using FadeInImage widget to load images from network

When the page is refreshed in mobile view from developers console, the images are loading fine, but in full view it gives me an Exception

The following ImageCodecException was thrown resolving an image codec:
Failed to load network image.
Image URL: https://api.gogoz.in/static/img/FF000001FV0000007.jpg
Trying to load an image from another domain? Find answers at:
https://flutter.dev/docs/development/platform-integration/web-images

When the exception was thrown, this was the stack:
...

Image provider: NetworkImage("https://api.gogoz.in/static/img/FF000001FV0000007.jpg", scale: 1)
Image key: NetworkImage("https://api.gogoz.in/static/img/FF000001FV0000007.jpg", scale: 1)

Im getting no ideas to solve this

question from:https://stackoverflow.com/questions/66060984/flutter-web-image-loading-in-mobile-view-but-not-in-full-view

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The issue:

It seems that with the most recent Beta release 1.26 (Feb 2021), the default renderer seems to have switched from html to canvaskit.

Fix:

When working in Web, use the html renderer instead of the canvaskit. This is how:

  • If you "run" from command line, use this:

flutter run -d chrome --web-renderer html

  • If you use Android Studio: Go to Run/ Run.../ Edit Configurations.../, then in Additional arguments add this --web-renderer html.

Dont forget to "mark" answer if this helped ;0)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...