mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-15 07:29:30 +00:00
something
This commit is contained in:
parent
dbf4ce1959
commit
a720c977c2
115 changed files with 8819 additions and 1 deletions
26
lib/db/init.dart
Normal file
26
lib/db/init.dart
Normal 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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue