Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter HttpException: Connection closed while receiving data

Tags:

http

flutter

dart

I am making a wallpaper app in Flutter but I get an exception when I use Image.Network() to get the images.

HttpException: Connection closed while receiving data

The files are currently stored on my system so the url is like this

http://10.0.2.2/wallipop/wallpapers/img/3.jpg

10.0.2.2 is for connecting to localhost from Android Emulator

Any help would be dearly appreciated

like image 789
Musa Usman Avatar asked Feb 24 '26 23:02

Musa Usman


1 Answers

I was able to get rid of the error when I used images of smaller size, my earlier images were upto 2MBs but then I wrote some PHP code that automatically generated thumbnails for all my images and then I used those in my app, and haven't encountered that error ever since.

like image 176
Musa Usman Avatar answered Feb 27 '26 14:02

Musa Usman