Flutter web Image.network() not loading but url is correct.

Phong Yew Tong
2 min readJan 9, 2023

--

Artur Shamsutdinov

Subscribe to TLDRStories.com to get your daily dose of tech news, condensed into a few stories.

I build my app for android and iOS. So recently flutter run it on the web and all hell broke lose. The first run didn't even work.

Image.network() errorbuilder was throwing this error below:

Error message

ImageCodecException: Failed to load network image.
Image URL: https://images.igdb.com/igdb/image/upload/t_cover_big/ss6bi7081my4mzebjkzb.png
Trying to load an image from another domain? Find answers at:
https://flutter.dev/docs/development/platform-integration/web-images

All the images on my web version didn't really work but it works on iOS and android.

Put this in your index.html and the images will start appearing!

<script type="text/javascript">
window.flutterWebRenderer = "html";
</script>

Weeeeeeeeeeโ€ฆ. it's fixed!

๐Ÿ˜ Follow me and drop me some claps ๐Ÿ‘๐Ÿ‘ ๐Ÿ‘ if this article helps you, it motivates ๐Ÿ’ช me to create more! Thank you, everyone! ๐Ÿ™

Subscribe to TLDRStories.com to get your daily dose of tech news, condensed into a few stories.

--

--

Phong Yew Tong
Phong Yew Tong

Written by Phong Yew Tong

Entrepreneurship, React, Flutter, Firebase, Typescript, Javascript, ChatGPT https://bento.me/tldrstories