removeInternalState method

Future<void> removeInternalState(
  1. String key
)

Remove internal state by key

Implementation

Future<void> removeInternalState(String key) async {
  if (!_isInitialized) {
    await initialize();
  }

  try {
    if (_useHive && _internalStateBox != null) {
      await _internalStateBox!.delete(key);
      ObslyLogger.debug('Removed internal state key from Hive: $key');
    } else if (_prefs != null) {
      await _prefs!.remove('obsly_state_$key');
      ObslyLogger.debug('Removed internal state key from SharedPreferences: $key');
    }
  } catch (e) {
    ObslyLogger.error('Error removing internal state for key "$key": $e');
  }
}