write method
Future<bool>
write({
- required String key,
- required String value,
- IOSOptions? iOptions,
- 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,
);
}