Skip to content

Commit 6d3ee77

Browse files
committed
更新重复文件弹窗文案
1 parent 2531456 commit 6d3ee77

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

lib/main.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,14 @@ class _MainAppState extends ConsumerState<MainApp> {
9494
debugPrint("收到文件路径: $data");
9595
// 在这里处理接收到的文件路径,比如将文件保存到filesProvider中
9696

97+
var xfile = XFile(data);
9798
var files = ref.read(filesProvider);
9899
var index = files.indexWhere((file) => file.path == data);
99100
if (index != -1) {
100-
DialogUtils.showInfoDialog(
101-
"No new APK files were dropped",
102-
"You can only drop APK files that are not already selected",
103-
);
101+
DialogUtils.showFileExsistDialog(xfile.name);
104102
return;
105103
}
106104

107-
var xfile = XFile(data);
108105
ref.read(filesProvider.notifier).state = [...files, xfile];
109106
});
110107
});

lib/utils/dialog_utils.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ class DialogUtils {
2929
);
3030
});
3131
}
32+
33+
static void showFileExsistDialog(String fileName) {
34+
showInfoDialog("File Exists", "File [$fileName] already exists.");
35+
}
3236
}

0 commit comments

Comments
 (0)