getCachedResponse static method
Retrieves cached response if available and valid.
Returns null on cache miss or when forceUpdate is true.
Implementation
static Future<HttpResponse<dynamic>?> getCachedResponse({
required String cacheKey,
required bool forceUpdate,
}) async {
if (forceUpdate) {
return null;
}
final cachedResponse = await HiveService.getCachedResponse(cacheKey);
if (cachedResponse != null) {
debugPrint('----HttpService: Using cached response-----');
}
return cachedResponse;
}