getParentPathEntities method

Future<List<AssetPathEntity>> getParentPathEntities(
  1. AssetPathEntity pathEntity
)
inherited

Request the parent folders containing pathEntity.

Mirrors getSubPathEntities but walks up the hierarchy. Backed by PHCollectionList.fetchCollectionListsContainingCollection:.

Implementation

Future<List<AssetPathEntity>> getParentPathEntities(
  AssetPathEntity pathEntity,
) async {
  assert(Platform.isIOS || Platform.isMacOS);
  final Map result = await _channel.invokeMethod(
    PMConstants.mGetParentPath,
    <String, dynamic>{
      'id': pathEntity.id,
      'type': pathEntity.type.value,
      'albumType': pathEntity.albumType,
      'option': pathEntity.filterOption?.toMap(),
    },
  );
  final items = result['list'] as Map;
  return ConvertUtils.convertToPathList(
    items.cast(),
    type: pathEntity.type,
    filterOption: pathEntity.filterOption,
  );
}