copyEnsureSync method

void copyEnsureSync(
  1. String newPath
)

Copy the file and create corresponding folders if necessary, to ensure that all folders in the newPath exists, that the file can be copied safely.

Implementation

void copyEnsureSync(String newPath) {
  File(newPath).parent.createSync(recursive: true);
  copySync(newPath);
}