something

This commit is contained in:
Dr-Blank 2024-05-08 05:03:49 -04:00
parent dbf4ce1959
commit a720c977c2
No known key found for this signature in database
GPG key ID: 7452CC63F210A266
115 changed files with 8819 additions and 1 deletions

26
lib/db/init.dart Normal file
View file

@ -0,0 +1,26 @@
// does the initial setup of the storage
import 'dart:io';
import 'package:hive/hive.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:whispering_pages/settings/constants.dart';
import 'register_models.dart';
Future initStorage() async {
final dir = await getApplicationDocumentsDirectory();
// use whispering_pages as the directory for hive
final storageDir = Directory(p.join(
dir.path,
AppMetadata.appName.toLowerCase().replaceAll(' ', '_'),
),
);
await storageDir.create(recursive: true);
Hive.defaultDirectory = storageDir.path;
await registerModels();
}