DecoderCallback typedef Null safety

  1. @Deprecated('Use DecoderBufferCallback with ImageProvider.loadBuffer instead. ' 'This feature was deprecated after v2.13.0-1.0.pre.')
DecoderCallback = Future<Codec> Function(Uint8List buffer, {bool allowUpscaling, int? cacheHeight, int? cacheWidth})

Performs the decode process for use in ImageProvider.load.

This typedef is deprecated. Use DecoderBufferCallback with ImageProvider.loadBuffer instead.

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

@Deprecated(
  'Use DecoderBufferCallback with ImageProvider.loadBuffer instead. '
  'This feature was deprecated after v2.13.0-1.0.pre.',
)
typedef DecoderCallback = Future<ui.Codec> Function(Uint8List buffer, {int? cacheWidth, int? cacheHeight, bool allowUpscaling});