copyAssetToGallery method

Future<AssetEntity> copyAssetToGallery(
  1. AssetEntity asset,
  2. AssetPathEntity pathEntity
)

Implementation

Future<AssetEntity> copyAssetToGallery(
  AssetEntity asset,
  AssetPathEntity pathEntity,
) async {
  if (pathEntity.isAll) {
    throw ArgumentError(
      "You can't copy the asset into the album containing all the pictures.",
    );
  }
  final Map result = await _channel.invokeMethod(
    PMConstants.mCopyAsset,
    <String, dynamic>{'assetId': asset.id, 'galleryId': pathEntity.id},
  );
  return ConvertUtils.convertMapToAsset(result.cast(), title: asset.title);
}