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