change iOS default local path to Documents (#68)

This commit is contained in:
boa
2024-11-23 00:25:38 +08:00
committed by GitHub
parent 2f290f0c86
commit c3474b1dff

View File

@@ -203,6 +203,14 @@ class LocalManager with ChangeNotifier {
} else {
path = FilePath.join(App.dataPath, 'local');
}
} else if (App.isIOS) {
var oldPath = FilePath.join(App.dataPath, 'local');
if (Directory(oldPath).existsSync() && Directory(oldPath).listSync().isNotEmpty) {
path = oldPath;
} else {
var directory = await getApplicationDocumentsDirectory();
path = FilePath.join(directory.path, 'local');
}
} else {
path = FilePath.join(App.dataPath, 'local');
}