diff --git a/lib/Components/cached_custom_resource.dart b/lib/Components/cached_custom_resource.dart index d038962..2c7db0f 100644 --- a/lib/Components/cached_custom_resource.dart +++ b/lib/Components/cached_custom_resource.dart @@ -103,7 +103,7 @@ class CachedCustomResource extends StatelessWidget { Future _checkIfLocalResourceExists(TabletAppContext tabletAppContext) async { try { - Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationSupportDirectory() : await getDownloadsDirectory(); + Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationDocumentsDirectory() : await getDownloadsDirectory(); String localPath = appDocumentsDirectory!.path; Directory configurationDirectory = Directory('$localPath/${tabletAppContext.configuration!.id}'); List fileList = configurationDirectory.listSync(); @@ -121,7 +121,7 @@ class CachedCustomResource extends StatelessWidget { } Future get localPath async { - Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationSupportDirectory() : await getDownloadsDirectory(); + Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationDocumentsDirectory() : await getDownloadsDirectory(); return appDocumentsDirectory!.path; } } diff --git a/lib/Components/loading_common.dart b/lib/Components/loading_common.dart index d4afa3c..dc9dd5a 100644 --- a/lib/Components/loading_common.dart +++ b/lib/Components/loading_common.dart @@ -92,7 +92,7 @@ class _LoadingCommonState extends State with TickerProviderStateM Future _checkIfLocalResourceExists(TabletAppContext tabletAppContext, String resourceId) async { try { - Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationSupportDirectory() : await getDownloadsDirectory(); + Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationDocumentsDirectory() : await getDownloadsDirectory(); String localPath = appDocumentsDirectory!.path; Directory configurationDirectory = Directory('$localPath/${tabletAppContext.configuration!.id}'); List fileList = configurationDirectory.listSync(); diff --git a/lib/Screens/PDF/pdf_view.dart b/lib/Screens/PDF/pdf_view.dart index e110278..48a7097 100644 --- a/lib/Screens/PDF/pdf_view.dart +++ b/lib/Screens/PDF/pdf_view.dart @@ -167,7 +167,7 @@ class _PDFViewWidget extends State { Future _checkIfLocalResourceExists(TabletAppContext tabletAppContext, String resourceId) async { try { - Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationSupportDirectory() : await getDownloadsDirectory(); + Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationDocumentsDirectory() : await getDownloadsDirectory(); String localPath = appDocumentsDirectory!.path; Directory configurationDirectory = Directory('$localPath/${tabletAppContext.configuration!.id}'); List fileList = configurationDirectory.listSync(); diff --git a/lib/main.dart b/lib/main.dart index f9beb35..7d8c051 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -25,7 +25,7 @@ void main() async { localContext = await DatabaseHelper.instance.getData(); } - Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationSupportDirectory() : await getDownloadsDirectory(); + Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationDocumentsDirectory() : await getDownloadsDirectory(); String localPath = appDocumentsDirectory!.path; if(localContext != null && localContext.host != null) {