2024-05-08 05:03:49 -04:00
|
|
|
import 'package:hive/hive.dart';
|
2025-11-14 16:34:42 +08:00
|
|
|
import 'package:vaani/globals.dart';
|
2024-05-08 05:03:49 -04:00
|
|
|
|
|
|
|
|
import 'register_models.dart';
|
|
|
|
|
|
2024-10-03 05:54:29 -04:00
|
|
|
// does the initial setup of the storage
|
2024-05-08 05:03:49 -04:00
|
|
|
Future initStorage() async {
|
2025-11-14 16:34:42 +08:00
|
|
|
// final dir = await getApplicationDocumentsDirectory();
|
2024-05-08 05:03:49 -04:00
|
|
|
|
2025-11-14 16:34:42 +08:00
|
|
|
// // use vaani as the directory for hive
|
|
|
|
|
// final storageDir = Directory(
|
|
|
|
|
// p.join(dir.path, appName),
|
|
|
|
|
// );
|
|
|
|
|
// await storageDir.create(recursive: true);
|
2024-05-08 05:03:49 -04:00
|
|
|
|
2025-11-14 16:34:42 +08:00
|
|
|
Hive.defaultDirectory = appStorageDir.path;
|
2024-10-03 05:54:29 -04:00
|
|
|
appLogger.config('Hive storage directory init: ${Hive.defaultDirectory}');
|
2024-05-08 05:03:49 -04:00
|
|
|
|
|
|
|
|
await registerModels();
|
|
|
|
|
}
|