How do you recursively remove an entire directory in Dart along with all the files?
For example:
/path/to/project/foo.dart
/path/to/project/remove/all/of/these
It's easier than it sounds.
If I understood you right, it would go like this:
import 'dart:io';
main() {
// Deletes the directory "remove" with all folders and files under it.
new Directory('remove').delete(recursive: true);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With