deleteFile static method
Deletes a file if it exists.
path
: The file path to delete.
Throws: Any exception encountered during deletion.
Implementation
static void deleteFile(String path) {
final file = File(path);
if (file.existsSync()) {
file.deleteSync();
}
}