copyTo method

Future<Directory> copyTo(
  1. Directory destination, [
  2. bool skipTopDirectory = false
])

Implementation

Future<Directory> copyTo(Directory destination, [bool skipTopDirectory = false]) async {
  if (this is Directory) {
    return (this as Directory).copy(destination, skipTopDirectory);
  }
  if (this is File) {
    await destination.create(recursive: true);
    var p = path.join(destination.path, name).fixPath;
    await (this as File).copy(p);
  }
  return destination;
}