getBaseFile method
Future<File?>
getBaseFile({
- bool isOrigin = true,
- PMProgressHandler? progressHandler,
- PMDarwinAVFileType? darwinFileType,
- PMCancelToken? cancelToken,
Obtain the base (unedited) file of the asset, before any adjustments were applied in the Photos app.
When the asset has no adjustments this resolves to the same content as
AssetEntity.originFile. Returns null if the base resource cannot be
exported.
isOriginrequests the original, full-resolution base resource.progressHandlerobserves the (possibly network-bound) export progress.darwinFileTypetries to define the export format, e.g. exporting a MOV file to MP4.cancelTokencancels the export.
See also:
- hasAdjustments to check whether a distinct base version exists.
Implementation
Future<File?> getBaseFile({
bool isOrigin = true,
PMProgressHandler? progressHandler,
PMDarwinAVFileType? darwinFileType,
PMCancelToken? cancelToken,
}) async {
final String? path = await plugin.getBaseAdjustmentFile(
_asset.id,
isOrigin: isOrigin,
progressHandler: progressHandler,
darwinFileType: darwinFileType,
cancelToken: cancelToken,
);
if (path == null) {
return null;
}
return File(path);
}