storeValue method

Future<void> storeValue(
  1. String key,
  2. String value, {
  3. bool requireBiometrics = false,
})

Store value with optional biometric protection

Implementation

Future<void> storeValue(String key, String value, {bool requireBiometrics = false}) async {
  try {
    if (requireBiometrics && await _isBiometricsAvailable()) {
      final authenticated = await _authenticateWithBiometrics('Store secure value');
      if (!authenticated) {
        throw Exception('Biometric authentication required');
      }
    }

    await _secureStorage.write(key: key, value: value);
    OnairosDebugHelper.log('✅ Value stored: $key');
  } catch (e) {
    OnairosDebugHelper.log('❌ Error storing value: $e');
    rethrow;
  }
}