Skip to content

Commit

Permalink
chore: MultiFrameImageStreamCompleter
Browse files Browse the repository at this point in the history
  • Loading branch information
atrope committed Oct 7, 2022
1 parent ef6d9c1 commit e812bb8
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';

import 'multi_image_stream_completer.dart';

import 'package:cached_network_image_platform_interface/cached_network_image_platform_interface.dart'
if (dart.library.io) '_image_loader.dart'
if (dart.library.html) 'package:cached_network_image_web/cached_network_image_web.dart'
Expand Down Expand Up @@ -74,8 +72,8 @@ class CachedNetworkImageProvider
ImageStreamCompleter load(
CachedNetworkImageProvider key, DecoderCallback decode) {
final chunkEvents = StreamController<ImageChunkEvent>();
return MultiImageStreamCompleter(
codec: _loadAsync(key, chunkEvents, decode),
return MultiFrameImageStreamCompleter(
codec: _loadAsync(key, chunkEvents, decode).first,
chunkEvents: chunkEvents.stream,
scale: key.scale,
informationCollector: () sync* {
Expand Down Expand Up @@ -115,8 +113,8 @@ class CachedNetworkImageProvider
ImageStreamCompleter loadBuffer(
CachedNetworkImageProvider key, DecoderBufferCallback decode) {
final chunkEvents = StreamController<ImageChunkEvent>();
return MultiImageStreamCompleter(
codec: _loadBufferAsync(key, chunkEvents, decode),
return MultiFrameImageStreamCompleter(
codec: _loadBufferAsync(key, chunkEvents, decode).first,
chunkEvents: chunkEvents.stream,
scale: key.scale,
informationCollector: () sync* {
Expand Down

0 comments on commit e812bb8

Please sign in to comment.