From 523c1cef49ce47d262b1363f8b3bdfc6a0aca3f1 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Sun, 3 Nov 2024 12:13:06 +0800 Subject: [PATCH 1/3] Update multi_image_stream_completer.dart --- .../lib/src/image_provider/multi_image_stream_completer.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cached_network_image/lib/src/image_provider/multi_image_stream_completer.dart b/cached_network_image/lib/src/image_provider/multi_image_stream_completer.dart index bc81795d..82c7f041 100644 --- a/cached_network_image/lib/src/image_provider/multi_image_stream_completer.dart +++ b/cached_network_image/lib/src/image_provider/multi_image_stream_completer.dart @@ -18,10 +18,12 @@ class MultiImageStreamCompleter extends ImageStreamCompleter { MultiImageStreamCompleter({ required Stream codec, required double scale, + String? debugLabel, Stream? chunkEvents, InformationCollector? informationCollector, }) : _informationCollector = informationCollector, _scale = scale { + this.debugLabel = debugLabel; codec.listen( (event) { if (_timer != null) { From 87624c01be78332e6378573e8e19881c76790f46 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Sun, 3 Nov 2024 12:18:29 +0800 Subject: [PATCH 2/3] Update cached_network_image_provider.dart --- .../lib/src/image_provider/cached_network_image_provider.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cached_network_image/lib/src/image_provider/cached_network_image_provider.dart b/cached_network_image/lib/src/image_provider/cached_network_image_provider.dart index 5dc3b908..4ce58bf8 100644 --- a/cached_network_image/lib/src/image_provider/cached_network_image_provider.dart +++ b/cached_network_image/lib/src/image_provider/cached_network_image_provider.dart @@ -81,6 +81,7 @@ class CachedNetworkImageProvider codec: _loadBufferAsync(key, chunkEvents, decode), chunkEvents: chunkEvents.stream, scale: key.scale, + debugLabel: key.url, informationCollector: () => [ DiagnosticsProperty('Image provider', this), DiagnosticsProperty('Image key', key), @@ -132,6 +133,7 @@ class CachedNetworkImageProvider codec: _loadImageAsync(key, chunkEvents, decode), chunkEvents: chunkEvents.stream, scale: key.scale, + debugLabel: key.url, informationCollector: () => [ DiagnosticsProperty('Image provider', this), DiagnosticsProperty('Image key', key), From 2ad9debc5d4f9a9dfbeb31a6a96c6888bcb69eed Mon Sep 17 00:00:00 2001 From: Alex Li Date: Sun, 3 Nov 2024 12:26:59 +0800 Subject: [PATCH 3/3] Update multi_image_stream_completer.dart --- .../multi_image_stream_completer.dart | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cached_network_image/lib/src/image_provider/multi_image_stream_completer.dart b/cached_network_image/lib/src/image_provider/multi_image_stream_completer.dart index 82c7f041..b9cf148b 100644 --- a/cached_network_image/lib/src/image_provider/multi_image_stream_completer.dart +++ b/cached_network_image/lib/src/image_provider/multi_image_stream_completer.dart @@ -103,7 +103,13 @@ class MultiImageStreamCompleter extends ImageStreamCompleter { _frameCallbackScheduled = false; if (!hasListeners) return; if (_isFirstFrame() || _hasFrameDurationPassed(timestamp)) { - _emitFrame(ImageInfo(image: _nextFrame!.image, scale: _scale)); + _emitFrame( + ImageInfo( + image: _nextFrame!.image, + scale: _scale, + debugLabel: debugLabel, + ), + ); _shownTimestamp = timestamp; _frameDuration = _nextFrame!.duration; _nextFrame = null; @@ -153,7 +159,13 @@ class MultiImageStreamCompleter extends ImageStreamCompleter { // This is not an animated image, just return it and don't schedule more // frames. - _emitFrame(ImageInfo(image: _nextFrame!.image, scale: _scale)); + _emitFrame( + ImageInfo( + image: _nextFrame!.image, + scale: _scale, + debugLabel: debugLabel, + ), + ); return; } _scheduleAppFrame();