copyAndRenameFile static method
Implementation
static Future<void> copyAndRenameFile(
String sourcePath,
String targetPath,
) async {
final sourceFile = File(sourcePath);
final targetFile = File(targetPath);
if (!await sourceFile.exists()) {
throw FileNotFoundException(sourcePath);
}
await targetFile.parent.create(recursive: true);
await sourceFile.copy(targetFile.path);
}