BloomNetworkTrace class

Recorded network request / response trace event.

Contains headers, request/response bodies, HTTP method, status codes, and roundtrip latency.

Example:

final trace = BloomNetworkTrace(
  id: 'req_123',
  method: 'GET',
  url: 'https://api.example.com/items',
  timestamp: DateTime.now(),
  statusCode: 200,
);

Constructors

BloomNetworkTrace({required String id, required String method, required String url, Map<String, String> headers = const {}, dynamic body, required DateTime timestamp, int? statusCode, dynamic responseBody, Duration? latency, String? error, bool isReplay = false, String? originalTraceId})
Creates a BloomNetworkTrace record.

Properties

body → dynamic
Request body payload.
final
error → String?
Error message if the request failed.
final
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, String>
Request headers map.
final
id → String
Unique request trace ID.
final
isReplay → bool
Whether this request was executed as a replay.
final
isSuccess → bool
Whether the response status code indicates success (2xx).
no setter
latency → Duration?
Network round-trip duration.
final
method → String
HTTP method string (e.g. 'GET', 'POST').
final
originalTraceId → String?
Original trace ID if this trace is a replay.
final
responseBody → dynamic
Response body data.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statusCode → int?
HTTP status code returned.
final
timestamp → DateTime
Timestamp when the request was dispatched.
final
url → String
Target request URL.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes trace event to a JSON map.
toString() → String
A string representation of this object.
inherited

Operators

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