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) {