loadThumbnail method

  1. @override
Future<Uint8List?> loadThumbnail(
  1. String localIdentifier, {
  2. int maxWidth = 256,
  3. int maxHeight = 256,
})
override

Load a downscaled thumbnail (JPEG bytes) for the photo-library asset identified by localIdentifier. Returns null when the asset cannot be resolved or decoded. maxWidth/maxHeight are an upper bound in logical pixels; aspect ratio is preserved. Default throws.

Implementation

@override
Future<Uint8List?> loadThumbnail(
  String localIdentifier, {
  int maxWidth = 256,
  int maxHeight = 256,
}) async {
  return _methodChannel.invokeMethod<Uint8List>(
    'loadThumbnail',
    {
      'localId': localIdentifier,
      'maxWidth': maxWidth,
      'maxHeight': maxHeight,
    },
  );
}