AnalyticsEvent constructor
AnalyticsEvent({
- required String eventId,
- required String name,
- required DateTime occurredAt,
- int schemaVersion = 1,
- String? surface = AnalyticsSurface.paywall,
- String? surfaceId,
- String? surfaceVersion,
- String? placementId,
- String? anonymousId,
- String? sessionId,
- String? surfaceSessionId,
- String? userId,
- AnalyticsAppContext? appContext,
- String? productId,
- String? offerId,
- Map<
String, Object?> properties = const <String, Object?>{},
Creates an event envelope.
surface defaults to AnalyticsSurface.paywall; pass null for an
app-wide / server event.
Implementation
AnalyticsEvent({
required this.eventId,
required this.name,
required this.occurredAt,
this.schemaVersion = 1,
this.surface = AnalyticsSurface.paywall,
this.surfaceId,
this.surfaceVersion,
this.placementId,
this.anonymousId,
this.sessionId,
this.surfaceSessionId,
this.userId,
this.appContext,
this.productId,
this.offerId,
Map<String, Object?> properties = const <String, Object?>{},
// Deep defensive copy: the envelope is `@immutable`, so a caller can
// neither mutate `properties` (or any nested map/list) after construction
// nor leak in a later mutation of the source structure.
}) : properties = _deepUnmodifiableMap(scrubReservedKeys(properties));