DecoderCallback typedef Null safety

DecoderCallback = Future<Codec> Function(Uint8List bytes, {bool allowUpscaling, int? cacheHeight, int? cacheWidth})

Performs the decode process for use in ImageProvider.load.

This callback allows decoupling of the cacheWidth, cacheHeight, and allowUpscaling parameters from implementations of ImageProvider that do not expose them.

See also:

  • ResizeImage, which uses this to override the cacheWidth, cacheHeight, and allowUpscaling parameters.

Implementation

typedef DecoderCallback = Future<ui.Codec> Function(Uint8List bytes, {int? cacheWidth, int? cacheHeight, bool allowUpscaling});