修复路径在windos下读取不到的问题 (#630)

* 修复路径在windos下读取不到的问题

* opt: `local.dart` fmt

---------

Co-authored-by: Noo6 <72285529+No06@users.noreply.github.com>
This commit is contained in:
fei1025
2024-11-14 14:42:15 +08:00
committed by GitHub
parent d706886343
commit 046f2c06d0

View File

@@ -65,6 +65,10 @@ class _LocalFilePageState extends State<LocalFilePage>
final path = await Pfs.pickFilePath();
if (path == null) return;
final name = path.getFileName() ?? 'imported';
final destinationDir = Directory(_path.path);
if (!await destinationDir.exists()) {
await destinationDir.create(recursive: true);
}
await File(path).copy(_path.path.joinPath(name));
setState(() {});
},