Reputation: 711
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
Upvotes: 3
Views: 5541
Reputation: 711
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.
Upvotes: 2