This commit is contained in:
LZX committed 2026-09-18 18:16:21 +08:00
1 parent 7a3db86a10
commit 3df0cbc7c0
10 files changed
+892 -38

No files matched your search

+13 -5
View File
@@ -301,16 +301,24 @@ class ProjectProvider extends ChangeNotifier {
}
Future<void> paste(FileItem targetDir) async {
if(!targetDir.isDirectory) return;
if (!targetDir.isDirectory) return;
await pasteToDirectory(targetDir.path);
}
if(_cutItem != null) {
Future<void> pasteToRoot() async {
if (rootPath == null || !canPaste) return;
await pasteToDirectory(rootPath!);
}
Future<void> pasteToDirectory(String dirPath) async {
if (_cutItem != null) {
final source = _cutItem!;
await FileService.instance.moveEntity(source.path, targetDir.path);
await FileService.instance.moveEntity(source.path, dirPath);
_cutItem = null;
await refreshTree();
}else if (_copiedItem != null) {
} else if (_copiedItem != null) {
final source = _copiedItem!;
await FileService.instance.copyEntity(source.path, targetDir.path);
await FileService.instance.copyEntity(source.path, dirPath);
await refreshTree();
}
}