deleteFilesSync method
Deletes a file from the specified path.
Parameters:
filePath: The path to the file. Throws:- Exception with message
⚠️ Failed to delete fileon failure.
Implementation
void deleteFilesSync({required String filePath}) {
try {
log('🗑️ Deleting file $filePath...');
final file = fs.file(filePath);
if (file.existsSync()) {
file.deleteSync();
log('✅ File deleted successfully: $filePath');
}
} catch (_) {
throw Exception('⚠️ Failed to delete: $filePath');
}
}