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 authored and martijn00 committed Jul 31, 2024
1 parent d07e95a commit 0d48bec
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 246 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.

2 changes: 1 addition & 1 deletion cached_network_image/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
cached_network_image_web: ^1.1.1
flutter:
sdk: flutter
flutter_cache_manager: ^3.3.1
flutter_cache_manager: ^3.3.2
octo_image: ^2.0.0

dev_dependencies:
Expand Down

0 comments on commit 0d48bec

Please sign in to comment.