If you do not have a custom implementation of
ImageProvider, this change will not impact you.
Change
ImageProvider.load will take an additional positional parameter DecoderCallback decode
The new signature is:
ImageStreamCompleter load(T key, DecoderCallback decode)
where DecodeCallback is:
typedef DecoderCallback = Future<ui.Codec> Function(Uint8List bytes, {int cacheWidth, int cacheHeight});
Justification
This change is to provide a way to pass the cacheWidth and cacheHeight values into a load call without redundantly making all ImageProviders directly know about these parameters when it is irrelevant. ResizeImage supplies the values through a closure.
Overall, this change allows fine control of the decoded and cached sizes of images.
Migration
Full migration is recommended, however, If you wish your code to simply work as before with no support for ResizeImage, simply add DecoderCallback decode to the load signature.
Full migration will require you to call the decode callback in place of PaintingBinding.instance.instantiateImageCodec()