read method

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

Reads a value from secure storage.

Returns the value associated with key if it exists, null otherwise. The value is returned as a String, regardless of the original type.

Example:

final value = await storage.read('settings.theme');
if (value != null) {
  print('Theme setting: $value');
}

See also:

  • write - Store a value
  • has - Check if a key exists

Implementation

@override
Future<String?> read(String key) async {
  return _storage.read(key: key);
}