diff --git a/lib/utils/path.dart b/lib/utils/path.dart index 2e1bd53..1898cb3 100644 --- a/lib/utils/path.dart +++ b/lib/utils/path.dart @@ -44,7 +44,8 @@ class Path { static Future copy(String startPath, String destPath, bool isDir, {required List? ignorePattern, - required List? ignoredList}) async { + required List? ignoredList, + bool isMove = false}) async { var c = Completer(); var result = true; if (ignorePattern != null) { @@ -78,7 +79,11 @@ class Path { var destDir = Directory(destPath); if (!destDir.existsSync()) destDir.createSync(recursive: true); print('File copy: $startPath --> $destChildPath'); - await File(startPath).copy(destChildPath); + var file = File(startPath); + await file.copy(destChildPath); + if (isMove) { + file.delete(recursive: true); + } } } on Exception catch (e) { result = false;