save method

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

Saves a value associated with the given key.

The value is a serialized string representation of the state. Implementations should handle overwriting existing values.

Throws an exception if the save operation fails.

Implementation

@override
Future<void> save(String key, String value) async {
  saveCount++;
  _savedKeys.add(key);
  if (saveDelay != null) await Future<void>.delayed(saveDelay!);
  if (saveError != null) throw saveError!;
  _data[key] = value;
}