fixes before build 2
This commit is contained in:
@@ -31,10 +31,18 @@ class ProductRepository extends ChangeNotifier {
|
||||
return _opening!;
|
||||
}
|
||||
|
||||
Future<String> _defaultDatabasePath() async {
|
||||
final dir = (await getApplicationDocumentsDirectory()).path;
|
||||
final groci = p.join(dir, 'groci.db');
|
||||
final legacy = p.join(dir, 'receipity.db');
|
||||
if (!File(groci).existsSync() && File(legacy).existsSync()) {
|
||||
await File(legacy).rename(groci);
|
||||
}
|
||||
return groci;
|
||||
}
|
||||
|
||||
Future<Database> _open() async {
|
||||
final path =
|
||||
databasePath ??
|
||||
p.join((await getApplicationDocumentsDirectory()).path, 'receipity.db');
|
||||
final path = databasePath ?? await _defaultDatabasePath();
|
||||
return openDatabase(
|
||||
path,
|
||||
version: 9,
|
||||
|
||||
Reference in New Issue
Block a user