write method

  1. @override
FutureOr<void> write(
  1. String key,
  2. dynamic value
)
override

Writes value associated with key to storage.

Implementation

@override
FutureOr<void> write(String key, dynamic value) => _mutex.protect(() async {
      final encoded = jsonEncode(value);
      // Duck-typing support for flutter_secure_storage write.
      // ignore: avoid_dynamic_calls
      await _secureStorage.write(key: _prefixedKey(key), value: encoded);
      _cache[key] = jsonDecode(encoded);
    });