thumbnailDataWithOption method

Future<Uint8List?> thumbnailDataWithOption(
  1. ThumbnailOption option, {
  2. PMProgressHandler? progressHandler,
})

Obtain the thumbnail data with the given customized ThumbnailOption.

See also:

Implementation

Future<typed_data.Uint8List?> thumbnailDataWithOption(
  ThumbnailOption option, {
  PMProgressHandler? progressHandler,
}) {
  assert(() {
    _checkThumbnailAssertion();
    return true;
  }());
  // Return null if the asset is audio or others.
  if (type == AssetType.audio || type == AssetType.other) {
    return Future<typed_data.Uint8List?>.value();
  }
  assert(() {
    option.checkAssertions();
    return true;
  }());
  return plugin.getThumbnail(
    id: id,
    option: option,
    progressHandler: progressHandler,
  );
}