remove method
Deletes files within the same bucket
paths
is an array of files to be deleted, including the path and file
name. For example: remove(['folder/image.png'])
.
Implementation
Future<List<FileObject>> remove(List<String> paths) async {
final options = FetchOptions(headers: headers);
final response = await _storageFetch.delete(
'$url/object/$bucketId',
{'prefixes': paths},
options: options,
);
final fileObjects = List<FileObject>.from(
(response as List).map(
(item) => FileObject.fromJson(item),
),
);
return fileObjects;
}