PeekEntry class final

One network call as Peek shows it: the request, whatever came back, and when it all happened.

Annotations

Constructors

PeekEntry({required PeekId id, required PeekRequest request, required DateTime startedAt, required String source, PeekResponse? response, PeekFailure? failure, DateTime? completedAt, bool isPinned = false, PeekTimings? timings})
Creates an entry. completedAt must be set exactly when a response or failure is.
const

Properties

completedAt → DateTime?
When the response or failure arrived; null while pending.
final
duration → Duration?
Time from start to completion; null while pending, never negative.
no setter
failure → PeekFailure?
What went wrong, if anything did.
final
hashCode → int
The hash code for this object.
no setteroverride
id → PeekId
Identifies the call across the events that built this entry.
final
isError → bool
Whether the call failed or the server answered with 4xx or 5xx.
no setter
isPinned → bool
Whether the user pinned the entry so it survives eviction.
final
request → PeekRequest
What was sent.
final
requestSize → int?
Request body size, when known.
no setter
response → PeekResponse?
What came back, if anything did.
final
responseSize → int?
Response body size, when known.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
source → String
The adapter that reported the call, such as dio.
final
startedAt → DateTime
When the request went out.
final
state → PeekEntryState
Where the call is in its life, derived from what is attached.
no setter
statusClass → PeekStatusClass?
The class of statusCode, when there is a response.
no setter
statusCode → int?
The response status code, when there is a response.
no setter
timings → PeekTimings?
Phase timings, for adapters that know them.
final
totalSize → int?
Request and response sizes added up; null when neither is known.
no setter

Methods

complete(PeekResponse response, {required DateTime at}) → PeekEntry
The entry once response has arrived at at.
copyWith({PeekRequest? request, PeekResponse? response, PeekFailure? failure, String? source, bool? isPinned, PeekTimings? timings}) → PeekEntry
A copy with the given fields replaced. Use complete and fail to move between states.
fail(PeekFailure failure, {required DateTime at, PeekResponse? response}) → PeekEntry
The entry once it failed with failure at at; response is the server answer when the failure came with one.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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