From 0886640b7eb78abeccfe47e8b0a758ccdbcf1f3f Mon Sep 17 00:00:00 2001 From: Flop Date: Sat, 27 Jul 2024 20:29:56 +0800 Subject: [PATCH] Improved debug console messages --- .../cached_network_image_provider.dart | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) 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 d853c535..e4b68ac6 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 @@ -78,13 +78,10 @@ class CachedNetworkImageProvider codec: _loadBufferAsync(key, chunkEvents, decode), chunkEvents: chunkEvents.stream, scale: key.scale, - informationCollector: () sync* { - yield DiagnosticsProperty( - 'Image provider: $this \n Image key: $key', - this, - style: DiagnosticsTreeStyle.errorProperty, - ); - }, + informationCollector: () => [ + DiagnosticsProperty('Image provider', this), + DiagnosticsProperty('Image key', key), + ], ); if (errorListener != null) { @@ -132,13 +129,10 @@ class CachedNetworkImageProvider codec: _loadImageAsync(key, chunkEvents, decode), chunkEvents: chunkEvents.stream, scale: key.scale, - informationCollector: () sync* { - yield DiagnosticsProperty( - 'Image provider: $this \n Image key: $key', - this, - style: DiagnosticsTreeStyle.errorProperty, - ); - }, + informationCollector: () => [ + DiagnosticsProperty('Image provider', this), + DiagnosticsProperty('Image key', key), + ], ); if (errorListener != null) {