delete method

Future<void> delete()

Delete the persisted state

Implementation

Future<void> delete() async {
  setPersistStateSingleton();
  try {
    final r = await _persistStateSingleton!.delete(key);
    cachedJson = null;
    if (debugPrintOperations) {
      StatesRebuilerLogger.log('PersistState: delete($key)');
    }
    return r;
  } catch (e, s) {
    if (catchPersistError) {
      StatesRebuilerLogger.log('Delete from localStorage error', e, s);
      return;
    }
    if (debugPrintOperations) {
      StatesRebuilerLogger.log(
        'PersistState: Delete Error ($key) :$e',
      );
    }
    rethrow;
  }
}