deleteFile function
Delete a file with the given path
Implementation
bool deleteFile(String path) {
final file = File(path);
if (!file.existsSync()) {
return false;
}
try {
// Delete the file
file.deleteSync();
return true;
} catch (e) {
logger.e('Error deleting file', error: e);
}
return false;
}