SentryEnvelopeItem.fromClientReport constructor

SentryEnvelopeItem.fromClientReport(
  1. ClientReport clientReport
)

Create a SentryEnvelopeItem which holds the ClientReport data.

Implementation

factory SentryEnvelopeItem.fromClientReport(ClientReport clientReport) {
  final cachedItem =
      _CachedItem(() async => utf8JsonEncoder.convert(clientReport.toJson()));

  return SentryEnvelopeItem(
    SentryEnvelopeItemHeader(
      SentryItemType.clientReport,
      cachedItem.getDataLength,
      contentType: 'application/json',
    ),
    cachedItem.getData,
    originalObject: clientReport,
  );
}