How to add default image to Image.network when it fails in flutter?

Posted by Andre Scott | Updated on

Want to add default image to Image.network when it fails in flutter? It depends on your use case, but one way to do it is to use FadeInImage which has a property of img for the image that is intended to load, and placeholder, well, for the placeholder.

You can also listen until the image is loaded and show a placeholder yourself until fetching the image resolves.

pseudo code


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers