initializeAllBoxes static method

Future initializeAllBoxes()

Implementation

static Future initializeAllBoxes() async {

  if(Platform.isIOS || Platform.isMacOS){
    final directory = await getApplicationDocumentsDirectory();
    globalFilesPath = directory.path;
  }else{
    final directory = await getTemporaryDirectory();
    globalFilesPath = directory.path;
  }
  // final directory = await getLibraryDirectory();
  customPrint('the path is $globalFilesPath');

  Hive.init(globalFilesPath);
  await BoxCollection.open(databaseName, {chatFilesBoxName}, path: globalFilesPath);
  chatFilesBox= await Hive.openBox(chatFilesBoxName);
  // await Hive.openBox(hiddenFilesBoxName);
}