Clear Cache: Delete content from iOS /tmp directory
This commit is contained in:
parent
15566f4078
commit
7c45201380
|
@ -25,6 +25,7 @@ class AppStorageViewer extends StatefulWidget {
|
|||
|
||||
class _AppStorageViewerState extends State<AppStorageViewer> {
|
||||
final List<PathStorageItem> paths = [];
|
||||
late String iosTempDirectoryPath;
|
||||
late bool internalUser;
|
||||
int _refreshCounterKey = 0;
|
||||
|
||||
|
@ -39,9 +40,9 @@ class _AppStorageViewerState extends State<AppStorageViewer> {
|
|||
final appDocumentsDirectory = (await getApplicationDocumentsDirectory());
|
||||
final appSupportDirectory = (await getApplicationSupportDirectory());
|
||||
final appTemporaryDirectory = (await getTemporaryDirectory());
|
||||
final iOSOnlyTempDirectory = "${appDocumentsDirectory.parent.path}/tmp/";
|
||||
iosTempDirectoryPath = "${appDocumentsDirectory.parent.path}/tmp/";
|
||||
final iOSPhotoManagerInAppCacheDirectory =
|
||||
iOSOnlyTempDirectory + "flutter-images";
|
||||
iosTempDirectoryPath + "flutter-images";
|
||||
final androidGlideCacheDirectory =
|
||||
"${appTemporaryDirectory.path}/image_manager_disk_cache/";
|
||||
|
||||
|
@ -84,7 +85,7 @@ class _AppStorageViewerState extends State<AppStorageViewer> {
|
|||
PathStorageItem.name(appTemporaryDirectory.path, "App Temp Dir"),
|
||||
]);
|
||||
if (!Platform.isAndroid) {
|
||||
paths.add(PathStorageItem.name(iOSOnlyTempDirectory, "/tmp directory"));
|
||||
paths.add(PathStorageItem.name(iosTempDirectoryPath, "/tmp directory"));
|
||||
}
|
||||
}
|
||||
if (mounted) {
|
||||
|
@ -171,6 +172,11 @@ class _AppStorageViewerState extends State<AppStorageViewer> {
|
|||
);
|
||||
}
|
||||
}
|
||||
if (!Platform.isAndroid) {
|
||||
await deleteDirectoryContents(
|
||||
iosTempDirectoryPath,
|
||||
);
|
||||
}
|
||||
_refreshCounterKey++;
|
||||
if (mounted) {
|
||||
setState(() => {});
|
||||
|
|
Loading…
Reference in a new issue