loadFile method

Future<File?> loadFile({
  1. bool isOrigin = true,
  2. bool withSubtype = false,
  3. PMProgressHandler? progressHandler,
  4. PMCancelToken? cancelToken,
  5. PMDarwinAVFileType? darwinFileType,
})

Obtain file of the asset with a PMProgressHandler.

withSubtype only takes effect on iOS, typically for Live Photos.

darwinFileType will try to define the export format when exporting assets, such as exporting a MOV file to MP4.

See also:

  • file which can obtain the compressed file.
  • fileWithSubtype which can obtain the compressed file with subtype.
  • originFile which can obtain the original file.
  • originFileWithSubtype which can obtain the origin file with subtype.
  • cancelToken is used to cancel the file loading process.

Implementation

Future<File?> loadFile({
  bool isOrigin = true,
  bool withSubtype = false,
  PMProgressHandler? progressHandler,
  PMCancelToken? cancelToken,
  PMDarwinAVFileType? darwinFileType,
}) {
  return getFile(
    isOrigin: isOrigin,
    subtype: withSubtype ? subtype : 0,
    progressHandler: progressHandler,
    darwinFileType: darwinFileType,
    cancelToken: cancelToken,
  );
}