loadBuffer method

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

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

Implementation

@override
ImageStreamCompleter loadBuffer(AssetBundleImageKey key, DecoderBufferCallback decode) {
  InformationCollector? collector;
  assert(() {
    collector = () => <DiagnosticsNode>[
      DiagnosticsProperty<ImageProvider>('Image provider', this),
      DiagnosticsProperty<AssetBundleImageKey>('Image key', key),
    ];
    return true;
  }());
  return MultiFrameImageStreamCompleter(
    codec: _loadAsync(key, decode: decode),
    scale: key.scale,
    debugLabel: key.name,
    informationCollector: collector,
  );
}