Skip to content

Instantly share code, notes, and snippets.

@tobischw
tobischw / copy_dir.dart
Last active March 8, 2023 15:32
Recursively copy directory in Dart (requires "path")
/*
* I'm sure there's a better way to do this, but this solution works for me.
* Recursively copies a directory + subdirectories into a target directory.
* You may want to replace calls to sync() with Futures. There's also no error handling. Have fun.
*/
import 'dart:io';
import 'package:path/path.dart' as path;
void copyDirectory(Directory source, Directory destination) =>