Baseflow / flutter_cached_network_image

Download, cache and show images in a flutter app
https://baseflow.com
2.45k stars 657 forks source link

Improved debug console messages #960

Closed hgraceb closed 3 months ago

hgraceb commented 3 months ago

:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Improved debug console messages. References from NetworkImage of flutter.

informationCollector: () => <DiagnosticsNode>[
  DiagnosticsProperty<image_provider.ImageProvider>('Image provider', this),
  DiagnosticsProperty<image_provider.NetworkImage>('Image key', key),
],

:arrow_heading_down: What is the current behavior?

======== Exception caught by image resource service ================================================
The following HttpExceptionWithStatus was thrown resolving an image codec:
HttpException: Invalid statusCode: 404, uri = https://blurha.sh/assets/images/img1.jpg

When the exception was thrown, this was the stack: 
Image provider: CachedNetworkImageProvider("https://blurha.sh/assets/images/img1.jpg", scale: 1.0) 
 Image key: CachedNetworkImageProvider("https://blurha.sh/assets/images/img1.jpg", scale: 1.0): CachedNetworkImageProvider("https://blurha.sh/assets/images/img1.jpg", scale: 1.0)
====================================================================================================

:new: What is the new behavior (if this is a feature change)?

======== Exception caught by image resource service ================================================
The following HttpExceptionWithStatus was thrown resolving an image codec:
HttpException: Invalid statusCode: 404, uri = https://blurha.sh/assets/images/img1.jpg

When the exception was thrown, this was the stack: 
Image provider: CachedNetworkImageProvider("https://blurha.sh/assets/images/img1.jpg", scale: 1.0)
Image key: CachedNetworkImageProvider("https://blurha.sh/assets/images/img1.jpg", scale: 1.0)
====================================================================================================

:boom: Does this PR introduce a breaking change?

No

:bug: Recommendations for testing

N/A

:memo: Links to relevant issues/docs

N/A

:thinking: Checklist before submitting