copyFile static method
Implementation
static Future<File> copyFile(String source, String destination) async {
ReceivePort receivePort = ReceivePort();
Isolate isolate = await Isolate.spawn(
_copyFileIsolate,
_CopyFileArguments(source, destination, receivePort.sendPort, false),
);
await receivePort.first;
isolate.kill();
var destFile = File(destination);
if (!destFile.existsSync()) {
throw Exception('file wasn\'t copied');
}
return destFile;
}