iosCreateFolder method
Future<AssetPathEntity>
iosCreateFolder(
- String name,
- bool isRoot,
- AssetPathEntity? parent
inherited
Implementation
Future<AssetPathEntity> iosCreateFolder(
String name,
bool isRoot,
AssetPathEntity? parent,
) async {
assert(Platform.isIOS || Platform.isMacOS);
final Map<String, dynamic> map = <String, dynamic>{
'name': name,
'isRoot': isRoot,
};
if (!isRoot && parent != null) {
map['folderId'] = parent.id;
}
final Map result = await _channel.invokeMethod(
PMConstants.mCreateFolder,
map,
);
if (result['errorMsg'] != null) {
throw PlatformException(
code: PMConstants.mCreateFolder,
message: result['errorMsg'],
);
}
return AssetPathEntity.fromId(result['id'] as String, albumType: 2);
}