read method

Future<String?> read({
  1. required String key,
  2. IOSOptions? iOptions,
  3. AndroidOptions? aOptions,
})

Read the value corresponding to the key. Returns null for non existing values. For secure storage, iOptions and aOptions allow more control on the data access policy.

Implementation

Future<String?> read({
  required String key,
  IOSOptions? iOptions,
  AndroidOptions? aOptions,
}) async {
  if (isMocking) {
    return mockEntries![key];
  }
  return _storage.read(
    key: key,
    iOptions: iOptions ?? _iosOptions,
    aOptions: aOptions ?? _androidOptions,
  );
}