NetworkTransaction class

Groups a correlated HTTP request with its response or error.

Used by the UI layer to display network logs as unified transactions instead of separate entries.

Constructors

NetworkTransaction({required String requestId, required ISpectLogData request, ISpectLogData? response, ISpectLogData? error})
const

Properties

duration Duration?
Duration from request to response/error, or null if still pending.
no setter
error ISpectLogData?
The error log, if the request failed.
final
hashCode int
The hash code for this object.
no setterinherited
isError bool
Whether the request resulted in an error.
no setter
isPending bool
Whether no response or error has been received yet.
no setter
isSuccess bool
Whether the request completed with a response (no error).
no setter
method String?
HTTP method from the request.
no setter
request ISpectLogData
The originating request log.
final
requestContentLength int?
Request body size in bytes, if reported.
no setter
requestContentType String?
Media type of the request body (e.g. application/json), if reported.
no setter
requestId String
The shared correlation ID linking these logs.
final
response ISpectLogData?
The response log, if the request completed successfully.
final
responseContentLength int?
Response body size in bytes, if reported.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int?
HTTP status code from response or error, if available.
no setter
statusMessage String?
HTTP status reason phrase (e.g. No Content), if reported.
no setter
url String?
Request URL.
no setter

Methods

copyWith({ISpectLogData? response, ISpectLogData? error}) NetworkTransaction
Returns a copy with updated response or error.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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