From 190a5279fae5de3ed9dc27bd9b5df2765383b382 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Thu, 8 Feb 2024 16:28:04 +0100 Subject: [PATCH] try another directory for video.. --- lib/Components/cached_custom_resource.dart | 4 ++-- lib/Components/loading_common.dart | 2 +- lib/Screens/PDF/pdf_view.dart | 2 +- lib/main.dart | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) 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) {