load method

  1. @override
ImageStreamCompleter load(
  1. NetworkToFileImage key,
  2. dynamic decode
)

Implementation

@override
ImageStreamCompleter load(NetworkToFileImage key, DecoderCallback decode) {
  // Ownership of this controller is handed off to [_loadAsync]; it is that
  // method's responsibility to close the controller's stream when the image
  // has been loaded or an error is thrown.
  final StreamController<ImageChunkEvent> chunkEvents = StreamController<ImageChunkEvent>();

  return MultiFrameImageStreamCompleter(
      codec: _loadAsync(key, chunkEvents, decode),
      chunkEvents: chunkEvents.stream,
      scale: key.scale,
      informationCollector: () {
        return <DiagnosticsNode>[
          ErrorDescription('Image provider: $this'),
          ErrorDescription('File: ${file?.path}'),
          ErrorDescription('Url: $url'),
        ];
      });
}