Save the database to the application cache folder

The documents folder is suggested for files that can't be generated by the
application itself
This commit is contained in:
Roland Geider
2024-01-11 21:14:41 +01:00
parent 802da6aa1c
commit 2c9a001f1c
2 changed files with 2 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ class ExerciseDatabase extends _$ExerciseDatabase {
LazyDatabase _openConnection() {
return LazyDatabase(() async {
final dbFolder = await getApplicationDocumentsDirectory();
final dbFolder = await getApplicationCacheDirectory();
final file = File(p.join(dbFolder.path, 'exercises.sqlite'));
return NativeDatabase.createInBackground(file);
});

View File

@@ -30,7 +30,7 @@ class IngredientDatabase extends _$IngredientDatabase {
LazyDatabase _openConnection() {
return LazyDatabase(() async {
final dbFolder = await getApplicationDocumentsDirectory();
final dbFolder = await getApplicationCacheDirectory();
final file = File(p.join(dbFolder.path, 'ingredients.sqlite'));
return NativeDatabase.createInBackground(file);
});