mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
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:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user