delete method

Future<void> delete(
  1. String? url
)

Delete the uploaded file in Firebase Storage by the url.

If the url is null, it does nothing.

It will produce an Exception on error.

Implementation

Future<void> delete(String? url) async {
  if (url == null || url == '') return;
  final storageRef = FirebaseStorage.instance.refFromURL(url);
  await storageRef.delete();

  return;
}