write method
Future<void>
write({
- required String key,
- required String? value,
- IOSOptions? iOptions = IOSOptions.defaultOptions,
- AndroidOptions? aOptions,
- LinuxOptions? lOptions,
Encrypts and saves the key
with the given value
.
If the key was already in the storage, its associated value is changed.
If the value is null, deletes associated value for the given key
.
key
shouldn't be null.
value
required value
iOptions
optional iOS options
aOptions
optional Android options
lOptions
optional Linux options
Can throw a PlatformException.
Implementation
Future<void> write({
required String key,
required String? value,
IOSOptions? iOptions = IOSOptions.defaultOptions,
AndroidOptions? aOptions,
LinuxOptions? lOptions,
}) =>
value != null
? _channel.invokeMethod('write', <String, dynamic>{
'key': key,
'value': value,
'options': _selectOptions(iOptions, aOptions, lOptions)
})
: delete(key: key, iOptions: iOptions, aOptions: aOptions);