SentryEnvelopeItem.fromTransaction constructor

SentryEnvelopeItem.fromTransaction(
  1. SentryTransaction transaction
)

Creates a SentryEnvelopeItem which sends SentryTransaction.

Implementation

factory SentryEnvelopeItem.fromTransaction(SentryTransaction transaction) {
  final header = SentryEnvelopeItemHeader(
    SentryItemType.transaction,
    contentType: 'application/json',
  );
  return SentryEnvelopeItem(
      header, () => utf8JsonEncoder.convert(transaction.toJson()),
      originalObject: transaction);
}