get method
Retrieves cached data for the given request options. Returns null if no valid cached data is found.
Implementation
Future<dynamic> get(RequestOptions options) async {
final cacheKey = _generateCacheKey(options);
final data = await _storage.get(cacheKey);
if (data == null) {
return null;
}
final cacheModel = CacheModel.fromMap(data);
if (cacheModel.isExpired) {
await _storage.delete(cacheKey);
return null;
}
return cacheModel.value;
}