deleteDictionaries method

Future<void> deleteDictionaries()

Delete all dictionary data from the database.

Implementation

Future<void> deleteDictionaries() async {
  /// New results may be wrong after dictionary is added so this has to be
  /// done.
  clearDictionaryResultsCache();

  ReceivePort receivePort = ReceivePort();
  DeleteDictionaryParams params = DeleteDictionaryParams(
    directoryPath: _databaseDirectory.path,
    sendPort: receivePort.sendPort,
  );

  await compute(deleteDictionariesHelper, params);
  await _dictionaryHistory.clear();

  dictionarySearchAgainNotifier.notifyListeners();
}