deleteImage function

Future<File> deleteImage(
  1. String name
)

tries to remove an Image given by its name , throws if unsuccessful

Implementation

Future<File> deleteImage(String name) async {
  //TODO: support web
  final file = (await localFile(name));
  if (!file.existsSync()) throw Exception("file $file doesnt exist");

  return await file.delete() as File;
}