ReportEvent class

Canonical, serializable error event. This object is immutable; sanitized payload can be embedded via withPayload.

Constructors

ReportEvent({required String id, required BaseException exception, required Map<String, dynamic> context, required DateTime timestamp, List<String> fingerprints = const [], List<Breadcrumb> breadcrumbs = const [], List<Attachment> attachments = const [], bool handled = true, Map<String, dynamic>? payload})
Constructs an immutable report event with optional initial payload.
const
ReportEvent.fromJson(String json)
Recreates a ReportEvent from a JSON string.
factory
ReportEvent.fromMap(Map<String, dynamic> map)
Rehydrates a ReportEvent from its map representation.
factory

Properties

attachments → List<Attachment>
Attachments associated with the event.
final
Breadcrumbs leading up to the event.
final
context → Map<String, dynamic>
Structured diagnostic context gathered for the event.
final
exception → BaseException
The captured exception details.
final
fingerprints → List<String>
Fingerprint hints used for deduplication and grouping.
final
handled → bool
Whether the error was handled (caught) at the call site.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
Stable identifier for the event.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timestamp → DateTime
Timestamp for when the event was created.
final

Methods

copyWith({String? id, BaseException? exception, Map<String, dynamic>? context, DateTime? timestamp, List<String>? fingerprints, List<Breadcrumb>? breadcrumbs, List<Attachment>? attachments, bool? handled}) → ReportEvent
Returns a copy of the event with updated fields.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → String
Serializes the event to a JSON string.
toMap() → Map<String, dynamic>
Returns the serialized map (prefer sanitized payload when present).
toString() → String
A string representation of this object.
inherited
withPayload(Map<String, dynamic> payload) → ReportEvent
Returns a copy embedding a pre-sanitized payload.

Operators

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

Static Methods

generateId() → String
Generates a monotonically increasing string ID.