onStartupTask method

  1. @override
Future<void> onStartupTask()
override

Implementation

@override
Future<void> onStartupTask() async {
  if (!kIsWeb) {
    String path =
        "${(await getApplicationDocumentsDirectory()).path}/${Arcane.app.title.toLowerCase()}";
    Hive.init(path);
    info("Initialized Native Hive storage location: $path");
  }

  await Future.wait([
    _hive("data").then((value) => _data = value),
    _hiveLazy("cache").then((value) => _cache = value),
  ]);

  success("Storage Initialized");
}