CacheResponse class

Response representation from cache store.

Available extensions

Constructors

CacheResponse({required CacheControl cacheControl, required List<int>? content, required DateTime? date, required String? eTag, required DateTime? expires, required List<int>? headers, required String key, required String? lastModified, required DateTime? maxStale, required CachePriority priority, required DateTime requestDate, required DateTime responseDate, required String url, required int statusCode})

Properties

cacheControl CacheControl
Response Cache-control header
final
content List<int>?
Response body
getter/setter pair
date DateTime?
Response Date header
final
eTag String?
ETag header
final
expires DateTime?
Expires header
final
hashCode int
The hash code for this object.
no setteroverride
headers List<int>?
Response headers
getter/setter pair
key String
Key used by store
final
lastModified String?
Last-modified header
final
maxStale DateTime?
Max stale expiry from CacheOptions.
final
priority CachePriority
Cache priority
final
requestDate DateTime
Absolute date representing date/time when request has been sent
final
responseDate DateTime
Absolute date representing date/time when response has been received
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
Initial status code to forward it when reloading from cache.
final
url String
Initial request URL
final

Methods

copyWith({CacheControl? cacheControl, List<int>? content, DateTime? date, String? eTag, DateTime? expires, List<int>? headers, String? key, String? lastModified, DateTime? maxStale, CachePriority? priority, DateTime? requestDate, DateTime? responseDate, String? url, int? statusCode}) CacheResponse
getHeaders() Map<String, String>
isExpired(CacheControl rqCacheCtrl) bool
Checks if response is expired.
isStaled() bool
Checks if response is staled from maxStale option.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readContent(CacheOptions options, {required bool readHeaders, required bool readBody}) Future<CacheResponse>
toResponse(RequestOptions options, {bool fromNetwork = false}) → Response

Available on CacheResponse, provided by the CacheResponseExtension extension

toString() String
A string representation of this object.
inherited
writeContent(CacheOptions options) Future<CacheResponse>

Operators

operator ==(covariant CacheResponse other) bool
The equality operator.
override