secureRead method

  1. @override
Future<String?> secureRead(
  1. String key
)
override

Read a value from secure storage

Implementation

@override
Future<String?> secureRead(String key) async {
  try {
    final value =
        await methodChannel.invokeMethod<String>('secureRead', {'key': key});
    return value;
  } on PlatformException catch (e) {
    if (e.code == 'KEY_NOT_FOUND') {
      return null;
    }
    throw MCPSecureStorageException(
        'Failed to read secure value: ${e.message}', e.details);
  }
}