write method

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

Write the value for the corresponding key. Overwrites it if it already exists. For secure storage, iOptions and aOptions allow more control on the data access policy.

Implementation

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