read method

  1. @override
Future<String?> read(
  1. String key
)

Read cookie string from the given key in the storage.

Implementation

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

  final value = _prefs!.getString(_keyPrefix + key);
  return value;
}