File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 });
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments