SentryEnvelope.fromEvent constructor
SentryEnvelope.fromEvent(
- SentryEvent event,
- SdkVersion sdkVersion, {
- String? dsn,
- SentryTraceContextHeader? traceContext,
- List<
SentryAttachment> ? attachments,
Create an SentryEnvelope with containing one SentryEnvelopeItem which holds the SentryEvent data.
Implementation
factory SentryEnvelope.fromEvent(
SentryEvent event,
SdkVersion sdkVersion, {
String? dsn,
SentryTraceContextHeader? traceContext,
List<SentryAttachment>? attachments,
}) {
return SentryEnvelope(
SentryEnvelopeHeader(
event.eventId,
sdkVersion,
dsn: dsn,
traceContext: traceContext,
),
[
SentryEnvelopeItem.fromEvent(event),
if (attachments != null)
...attachments.map((e) => SentryEnvelopeItem.fromAttachment(e))
],
);
}