update method

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

Updates the value of a key. Fails if it does not exist.

Implementation

@override
Future<void> update(String key, T value) async {
  _checkInitialized();

  final String keyWithPrefix = _addPrefix(key);
  if (!map.containsKey(keyWithPrefix)) {
    throw Errors.getInternalError(Errors.NO_MATCHING_KEY);
  } else {
    _map[keyWithPrefix] = value;
    await _updatePref(keyWithPrefix, value);
  }
}