saveLivePhoto method
Future<AssetEntity>
saveLivePhoto({
- required File imageFile,
- required File videoFile,
- required String? title,
- String? desc,
- 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);
}