deleteMultipleImagesFromFirebaseByUrls static method
Deletes multiple images from Firebase Storage by their URLs.
The imageUrlList
parameter specifies a list of URLs of the images to delete.
If the list is empty, the function returns immediately.
If the deletion of any image fails, an exception is thrown.
Implementation
static Future<void> deleteMultipleImagesFromFirebaseByUrls(
List<String> imageUrlList,
) async {
if (imageUrlList.isEmpty) return;
try {
final functionList =
imageUrlList.map((url) => _checkAndDeleteImage(url)).toList();
await Future.wait(functionList);
log('Images deleted successfully');
} catch (e) {
throw Exception('deleteMultipleImagesFromFirebaseByUrls() $e');
}
}