move 기능 추가
This commit is contained in:
parent
49c66d8c9d
commit
560e0535e1
1 changed files with 7 additions and 2 deletions
|
|
@ -44,7 +44,8 @@ class Path {
|
|||
|
||||
static Future<bool> copy(String startPath, String destPath, bool isDir,
|
||||
{required List<String>? ignorePattern,
|
||||
required List<String>? ignoredList}) async {
|
||||
required List<String>? ignoredList,
|
||||
bool isMove = false}) async {
|
||||
var c = Completer<bool>();
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue