getCachedResponseText method
Implementation
Future<String?> getCachedResponseText(RequestApi request) async {
try {
FileInfo? fileInfo = await getFileFromCache(
"${request.uri.toString()}-${json.encode(request.body)}-${json.encode(request.bodyJson)}}");
if (fileInfo == null || !fileInfo.file.existsSync()) return null;
List<int> byteList = fileInfo.file.readAsBytesSync();
return utf8.decode(byteList);
} catch (_) {
return null;
}
}