copyFile function

void copyFile(
  1. String from,
  2. String to, {
  3. bool recursive = false,
})

Copies a file from the source file to the destination file.

Implementation

void copyFile(String from, String to, {bool recursive = false}) {
  if (recursive) {
    File(to).createSync(recursive: true);
  }
  File(from).copySync(to);
}