mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-01-13 13:49:32 +00:00
Some checks are pending
Flutter CI & Release / Test (push) Waiting to run
Flutter CI & Release / Build Android APKs (push) Blocked by required conditions
Flutter CI & Release / build_linux (push) Blocked by required conditions
Flutter CI & Release / Create GitHub Release (push) Blocked by required conditions
23 lines
722 B
Dart
23 lines
722 B
Dart
import 'dart:io';
|
|
|
|
import 'package:hive_plus_secure/hive_plus_secure.dart';
|
|
import 'package:path/path.dart' as p;
|
|
import 'package:path_provider/path_provider.dart';
|
|
import 'package:vaani/main.dart';
|
|
import 'package:vaani/settings/constants.dart';
|
|
|
|
import 'register_models.dart';
|
|
|
|
// does the initial setup of the storage
|
|
Future initStorage() async {
|
|
final dir = await getApplicationDocumentsDirectory();
|
|
|
|
// use vaani as the directory for hive
|
|
final storageDir = Directory(p.join(dir.path, AppMetadata.appNameLowerCase));
|
|
await storageDir.create(recursive: true);
|
|
|
|
Hive.defaultDirectory = storageDir.path;
|
|
appLogger.config('Hive storage directory init: ${Hive.defaultDirectory}');
|
|
|
|
await registerModels();
|
|
}
|