saveLivePhoto method

Future<AssetEntity> saveLivePhoto({
  1. required File imageFile,
  2. required File videoFile,
  3. required String? title,
  4. String? desc,
  5. String? relativePath,
})
inherited

Implementation

Future<AssetEntity> saveLivePhoto({
  required File imageFile,
  required File videoFile,
  required String? title,
  String? desc,
  String? relativePath,
}) async {
  assert(Platform.isIOS || Platform.isMacOS);
  if (!imageFile.existsSync()) {
    throw ArgumentError('The image file does not exists.');
  }
  if (!videoFile.existsSync()) {
    throw ArgumentError('The video file does not exists.');
  }
  final Map result = await _channel.invokeMethod(
    PMConstants.mSaveLivePhoto,
    <String, dynamic>{
      'imagePath': imageFile.absolute.path,
      'videoPath': videoFile.absolute.path,
      'title': title,
      'desc': desc,
      'relativePath': relativePath,
      ...onlyAddPermission,
    },
  );
  return ConvertUtils.convertMapToAsset(result.cast(), title: title);
}