Baseflow / flutter_cached_network_image

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

Adds `debugLabel` for the image stream completer #984

Open AlexV525 opened 2 weeks ago

AlexV525 commented 2 weeks ago

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

This is a bug fix. Fixes #973

This also helps to display the info in the Flutter Inspector.

As a reference, this is how the MultiFrameImageStreamCompleter implements the debugLevel. https://github.com/flutter/flutter/blob/574b7e765d86f3f70eac8817a2906ac3099c0bf9/packages/flutter/lib/src/painting/image_stream.dart#L967

:arrow_heading_down: What is the current behavior?

======== Exception caught by painting library ======================================================
The following message was thrown while painting an image:
Image null has a display size of 794×529 but a decode size of 1956×1280, which uses an additional 10849KB (assuming a device pixel ratio of 2.625).

Consider resizing the asset ahead of time, supplying a cacheWidth parameter of 794, a cacheHeight parameter of 529, or using a ResizeImage.

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

======== Exception caught by painting library ======================================================
The following message was thrown while painting an image:
Image https://example.com/redact.jpeg has a display size of 794×529 but a decode size of 1956×1280, which uses an additional 10849KB (assuming a device pixel ratio of 2.625).

Consider resizing the asset ahead of time, supplying a cacheWidth parameter of 794, a cacheHeight parameter of 529, or using a ResizeImage.

:boom: Does this PR introduce a breaking change?

No.