copyFile static method

void copyFile(
  1. String sourcePath,
  2. String destinationPath
)

Implementation

static void copyFile(String sourcePath, String destinationPath) {
  final sourceFile = File(sourcePath);
  if (!sourceFile.existsSync()) {
    throw FileSystemException('Source file not found', sourcePath);
  }
  final destinationFile = File(destinationPath);
  destinationFile.createSync(recursive: true);
  sourceFile.copySync(destinationPath);
}