CachedHttpResponse class

Represents an HTTP response stored in cache.

Constructors

CachedHttpResponse({required Uint8List bytes, required int statusCode, required Map<String, String> headers, required DateTime createdAt})
CachedHttpResponse.fromMap(Map map)
Constructs a CachedHttpResponse from a serialized map (e.g. from Hive).
factory

Properties

bytes → Uint8List
Binary payload of the response.
final
createdAt → DateTime
Timestamp when the entry was placed in cache.
final
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, String>
Response HTTP headers.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statusCode → int
HTTP status code of the response.
final

Methods

isExpired(Duration ttl) → bool
Checks if this cached entry has exceeded the allowed ttl.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, dynamic>
Serializes this response entry into a Map for disk storage.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited