deleteFileDirectoryWindows static method

void deleteFileDirectoryWindows()

Implementation

static void deleteFileDirectoryWindows() async {
  Directory updateDirectory = await directoryWindows();

  if (await updateDirectory.exists()) {
    // List all files in the directory
    List<FileSystemEntity> files = updateDirectory.listSync();

    // Delete each file in the directory
    for (var file in files) {
      if (file is File) {
        await file.delete();
        log('Deleted file successfully: ${file.path}');
      }
    }
  }
}