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 May 30, 2024
1 parent fcc7a9e commit 7fbf8ef
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 271 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 @@ -74,8 +73,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: () sync* {
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: () sync* {
Expand Down

This file was deleted.

0 comments on commit 7fbf8ef

Please sign in to comment.