deleteIfExists method

Future<bool> deleteIfExists(
  1. String fileName
)

Deletes a file if present and returns true when no file remains.

Implementation

Future<bool> deleteIfExists(String fileName) async {
  _validateFileName(fileName);
  if (!await NexoraSdkPlatform.instance.fileExists(fileName)) return true;
  return NexoraSdkPlatform.instance.deleteFile(fileName);
}