mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 22:39:34 +00:00
更改appName等常量为全局变量
This commit is contained in:
parent
896f8837bd
commit
e2aa73c01c
35 changed files with 167 additions and 216 deletions
|
|
@ -1,27 +1,19 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:hive/hive.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 'package:vaani/globals.dart';
|
||||
|
||||
import 'register_models.dart';
|
||||
|
||||
// does the initial setup of the storage
|
||||
Future initStorage() async {
|
||||
final dir = await getApplicationDocumentsDirectory();
|
||||
// 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);
|
||||
// // use vaani as the directory for hive
|
||||
// final storageDir = Directory(
|
||||
// p.join(dir.path, appName),
|
||||
// );
|
||||
// await storageDir.create(recursive: true);
|
||||
|
||||
Hive.defaultDirectory = storageDir.path;
|
||||
Hive.defaultDirectory = appStorageDir.path;
|
||||
appLogger.config('Hive storage directory init: ${Hive.defaultDirectory}');
|
||||
|
||||
await registerModels();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue