saveImageWithPath method
Implementation
Future<AssetEntity?> saveImageWithPath(
String path, {
required String title,
String? desc,
String? relativePath,
}) async {
final File file = File(path);
if (!file.existsSync()) {
assert(false, 'File must exists.');
return null;
}
final Map<dynamic, dynamic>? result = await _channel.invokeMethod(
PMConstants.mSaveImageWithPath,
<String, dynamic>{
'path': path,
'title': title,
'desc': desc ?? '',
'relativePath': relativePath,
...onlyAddPermission,
},
);
if (result == null) {
return null;
}
return ConvertUtils.convertMapToAsset(
result.cast<String, dynamic>(),
title: title,
);
}