setString method

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

Saves a String value with the given key.

This method stores a string value in the storage, associating it with the specified key. If a value already exists for this key, it will be replaced.

Parameters:

  • key - The unique identifier for the string value.
  • value - The string value to store.

Returns a Future that completes when the string has been successfully stored.

Throws:

Implementation

@override
Future<void> setString(String key, String value) async {
  validateKey(key);
  await backend.setString(key, value);
  notifyListeners(key);
}