1

I'm newbie in flutter and facing issue while loading image through URL.

Image URL in my project is like this

10.20.3.169\uploads/room/1494073006dz15k9b.jpg

As you can see the URL slashes are not correct. When I put that url in browser, It automatically correct the url and load the image. But CachedNetworkImage library not loading the image.

For testing purpose I correct the URl to

10.20.3.169/uploads/room/1494073006dz15k9b.jpg

Now CachedNetworkImage is working fine.

Do I need to encode URL before loading image ? if Yes then how can I achieve it ?

Please help me in this.

dshukertjr
  • 15,244
  • 11
  • 57
  • 94
Anuj Sharma
  • 4,294
  • 2
  • 37
  • 53

1 Answers1

0

As @Günter Zöchbauer said after correcting API URL, and adding http:// its working fine. Web browser corrects the url automatically but for CachedNetworkImage we need to pass exact URL. If we pass URL without http:// then library tried to pick image from file and give exception.

Anuj Sharma
  • 4,294
  • 2
  • 37
  • 53