setJSONWithTimeout method
store (key, jsonData) pair. cache expires after timeout.
jsonData is converted to string using json.encode and stored as (JSON) String.
Implementation
Future<void> setJSONWithTimeout(
String key, dynamic data, Duration timeout) async {
String value = json.encode(data);
await _writeString(key, value);
await _setTimeout(key, timeout);
}