SentryEnvelopeItem.fromEvent constructor

SentryEnvelopeItem.fromEvent(
  1. SentryEvent event
)

Create a SentryEnvelopeItem which holds the SentryEvent data.

Implementation

factory SentryEnvelopeItem.fromEvent(SentryEvent event) {
  return SentryEnvelopeItem(
    SentryEnvelopeItemHeader(
      event.type == 'feedback' ? 'feedback' : SentryItemType.event,
      contentType: 'application/json',
    ),
    () => utf8JsonEncoder.convert(event.toJson()),
    originalObject: event,
  );
}