mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 08:31:19 +00:00
try other storage iOS
This commit is contained in:
parent
941cc71ffc
commit
5ad903da8e
@ -103,7 +103,7 @@ class CachedCustomResource extends StatelessWidget {
|
||||
|
||||
Future<File?> _checkIfLocalResourceExists(TabletAppContext tabletAppContext) async {
|
||||
try {
|
||||
Directory? appDocumentsDirectory = await getDownloadsDirectory();
|
||||
Directory? appDocumentsDirectory = Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationSupportDirectory() : await getDownloadsDirectory();
|
||||
String localPath = appDocumentsDirectory!.path;
|
||||
Directory configurationDirectory = Directory('$localPath/${tabletAppContext.configuration!.id}');
|
||||
List<FileSystemEntity> fileList = configurationDirectory.listSync();
|
||||
@ -121,7 +121,7 @@ class CachedCustomResource extends StatelessWidget {
|
||||
}
|
||||
|
||||
Future<String> get localPath async {
|
||||
Directory? appDocumentsDirectory = await getDownloadsDirectory();
|
||||
Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationSupportDirectory() : await getDownloadsDirectory();
|
||||
return appDocumentsDirectory!.path;
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ class _LoadingCommonState extends State<LoadingCommon> with TickerProviderStateM
|
||||
|
||||
Future<File?> _checkIfLocalResourceExists(TabletAppContext tabletAppContext, String resourceId) async {
|
||||
try {
|
||||
Directory? appDocumentsDirectory = await getDownloadsDirectory();
|
||||
Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationSupportDirectory() : await getDownloadsDirectory();
|
||||
String localPath = appDocumentsDirectory!.path;
|
||||
Directory configurationDirectory = Directory('$localPath/${tabletAppContext.configuration!.id}');
|
||||
List<FileSystemEntity> fileList = configurationDirectory.listSync();
|
||||
|
||||
@ -167,7 +167,7 @@ class _PDFViewWidget extends State<PDFViewWidget> {
|
||||
|
||||
Future<File?> _checkIfLocalResourceExists(TabletAppContext tabletAppContext, String resourceId) async {
|
||||
try {
|
||||
Directory? appDocumentsDirectory = await getDownloadsDirectory();
|
||||
Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationSupportDirectory() : await getDownloadsDirectory();
|
||||
String localPath = appDocumentsDirectory!.path;
|
||||
Directory configurationDirectory = Directory('$localPath/${tabletAppContext.configuration!.id}');
|
||||
List<FileSystemEntity> fileList = configurationDirectory.listSync();
|
||||
|
||||
@ -25,7 +25,7 @@ void main() async {
|
||||
localContext = await DatabaseHelper.instance.getData();
|
||||
}
|
||||
|
||||
Directory? appDocumentsDirectory = await getDownloadsDirectory();
|
||||
Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationSupportDirectory() : await getDownloadsDirectory();
|
||||
String localPath = appDocumentsDirectory!.path;
|
||||
|
||||
if(localContext != null && localContext.host != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user