load method Null safety

  1. @override
ImageStreamCompleter load(
  1. FileImage key,
  2. DecoderCallback decode

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

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 load(FileImage key, DecoderCallback decode) {
  return MultiFrameImageStreamCompleter(
    codec: _loadAsync(key, decode),
    scale: key.scale,
    debugLabel: key.file.path,
    informationCollector: () sync* {
      yield ErrorDescription('Path: ${file.path}');