loadLocalOrNetworkImageCodec function
Stream<Codec>
loadLocalOrNetworkImageCodec({
- required LoadImageOption option,
- required dynamic decode,
- StreamController<
ImageChunkEvent> ? chunkEvents, - void evictImageAsync()?,
Loads local image codec or cached network image codec, using given option
and chunkEvents
,
which is used by LocalOrCachedNetworkImageProvider. If the image is downloaded, it will also
be recorded to given CacheManager
.
Implementation
Stream<ui.Codec> loadLocalOrNetworkImageCodec({
required LoadImageOption option,
required DecoderCallback decode,
StreamController<ImageChunkEvent>? chunkEvents,
void Function()? evictImageAsync,
}) async* {
var stream = loadLocalOrNetworkImageBytes(
option: option,
chunkEvents: chunkEvents,
evictImageAsync: evictImageAsync,
);
await for (var bytes in stream) {
yield await decode(bytes);
}
}