copyFile static method
Implementation
static Future<void> copyFile(String sourcePath, String targetPath) async {
try {
final file = File(sourcePath);
Directory(p.dirname(targetPath)).createSync(recursive: true);
await file.copy(targetPath);
print('File copied: $sourcePath -> $targetPath');
} catch (e) {
print('Error copying file: $e');
}
}