write method

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

Persists the key/value pair.

Implementation

@override
Future<void> write(String key, dynamic value) => Future.sync(() {
      _checkOpen('write');
      // Both throw before the write is queued, so read and keys never
      // show a write that cannot land.
      final file = _fileOf(key);
      final bytes = _codec.encode(value)! as Uint8List;
      return _pending.write(
        key,
        bytes,
        () => _locked('write', () => _writeFile(key, file, bytes)),
      );
    });