Skip to content

Commit

Permalink
Replace Stream<ui.Codec> with Future<ui.Codec>
Browse files Browse the repository at this point in the history
  • Loading branch information
lwj1994 committed Aug 22, 2024
1 parent 0775e1f commit 6a855b2
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 1,159 deletions.
1 change: 0 additions & 1 deletion cached_network_image/lib/cached_network_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ export 'package:flutter_cache_manager/flutter_cache_manager.dart'

export 'src/cached_image_widget.dart';
export 'src/image_provider/cached_network_image_provider.dart';
export 'src/image_provider/multi_image_stream_completer.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class ImageLoader implements platform.ImageLoader {
headers: headers,
key: cacheKey,
);

await for (final result in stream) {
if (result is DownloadProgress) {
chunkEvents.add(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async' show Future, StreamController;
import 'dart:ui' as ui show Codec;

import 'package:cached_network_image/src/image_provider/multi_image_stream_completer.dart';
import 'package:cached_network_image_platform_interface/cached_network_image_platform_interface.dart'
show ErrorListener, ImageRenderMethodForWeb;
import 'package:cached_network_image_platform_interface/cached_network_image_platform_interface.dart'
Expand Down Expand Up @@ -77,8 +76,8 @@ class CachedNetworkImageProvider
DecoderBufferCallback decode,
) {
final chunkEvents = StreamController<ImageChunkEvent>();
final imageStreamCompleter = MultiImageStreamCompleter(
codec: _loadBufferAsync(key, chunkEvents, decode),
final imageStreamCompleter = MultiFrameImageStreamCompleter(
codec: _loadBufferAsync(key, chunkEvents, decode).first,
chunkEvents: chunkEvents.stream,
scale: key.scale,
informationCollector: () => <DiagnosticsNode>[
Expand Down Expand Up @@ -128,8 +127,8 @@ class CachedNetworkImageProvider
ImageDecoderCallback decode,
) {
final chunkEvents = StreamController<ImageChunkEvent>();
final imageStreamCompleter = MultiImageStreamCompleter(
codec: _loadImageAsync(key, chunkEvents, decode),
final imageStreamCompleter = MultiFrameImageStreamCompleter(
codec: _loadImageAsync(key, chunkEvents, decode).first,
chunkEvents: chunkEvents.stream,
scale: key.scale,
informationCollector: () => <DiagnosticsNode>[
Expand Down

This file was deleted.

Loading

0 comments on commit 6a855b2

Please sign in to comment.