loadBuffer method

  1. @override
ImageStreamCompleter loadBuffer(
  1. FileImage key,
  2. DecoderBufferCallback decode

Converts a key into an ImageStreamCompleter, and begins fetching the image.

This method is deprecated. Implement loadImage instead.

The decode callback provides the logic to obtain the codec for the image.

See also:

  • ResizeImage, for modifying the key to account for cache dimensions.


ImageStreamCompleter loadBuffer(FileImage key, DecoderBufferCallback decode) {
  return MultiFrameImageStreamCompleter(
    codec: _loadAsync(key, decode: decode),
    scale: key.scale,
    debugLabel: key.file.path,
    informationCollector: () => <DiagnosticsNode>[
      ErrorDescription('Path: ${file.path}'),