iosCreateAlbum method

Future<AssetPathEntity?> iosCreateAlbum(
  1. String name,
  2. bool isRoot,
  3. AssetPathEntity? parent
)
inherited

Implementation

Future<AssetPathEntity?> iosCreateAlbum(
  String name,
  bool isRoot,
  AssetPathEntity? parent,
) async {
  final Map<String, dynamic> map = <String, dynamic>{
    'name': name,
    'isRoot': isRoot,
  };
  if (!isRoot && parent != null) {
    map['folderId'] = parent.id;
  }
  final Map<dynamic, dynamic>? result = await _channel.invokeMethod(
    PMConstants.mCreateAlbum,
    map,
  );
  if (result == null) {
    return null;
  }
  if (result['errorMsg'] != null) {
    return null;
  }
  return AssetPathEntity.fromId(result['id'] as String);
}