write method

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

Write cookie value with the given key to the storage.

Implementation

@override
Future<void> write(String key, Object value) async {
  // Ensure _prefs has been initialized before using it
  _prefs ??= await SharedPreferences.getInstance();

  _prefs!.setString(_keyPrefix + key, value.toString());
}