initStorage method

Future<void> initStorage()

初始化本地存储数据

Implementation

Future<void> initStorage() async {
  if (!kIsWeb) {
    _appDirectory = await getApplicationSupportDirectory();

    final rootDirectory = Directory(p.join(appDirectory.path, rootFolder));
    if (!rootDirectory.existsSync()) rootDirectory.createSync();
  }

  await createStorage();
  await createStorage();
}