Flutter CachedNetworkImage errors: (CacheManager: Failed to download file) and (SocketException or HttpException) Flutter CachedNetworkImage errors: (CacheManager: Failed to download file) and (SocketException or HttpException) dart dart

Flutter CachedNetworkImage errors: (CacheManager: Failed to download file) and (SocketException or HttpException)


The creator of cached_network_image says (source):

If you have break on exceptions enabled the debugger stops, but that's because the dart VM doesn't always know whether an exception is caught or not. If you continue this still shouldn't freeze your app.

That was the key I needed. It is just the debugger stopping. You can hit the continue button or disable stopping on uncaught exceptions. The CachedNetworkImage widget will then show the errorWidget as expected.

In VS Code you can uncheck this in the bottom left of the debug pannel.

enter image description here

enter image description here

I believe there is a similar setting in Android studio based on this post.