thumbnailDataWithOption method
Future<Uint8List?>
thumbnailDataWithOption(
- ThumbnailOption option, {
- PMProgressHandler? progressHandler,
Obtain the thumbnail data with the given customized ThumbnailOption.
See also:
- thumbnailData which obtain the thumbnail data with fixed size.
- thumbnailDataWithSize which is a common method to obtain thumbnails.
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,
);
}