getString method

Future<String?> getString(
  1. String key
)

get string value for key.

if cache entry is expired or not found, returns null.

Implementation

Future<String?> getString(String key) async {
  if (!_initialized) {
    await init();
  }
  final timeout = remainingDurationForKey(key);
  if (timeout.isNegative) {
    return null;
  }
  return await _readString(key);
}