copyWith method

TrackEvent copyWith({
  1. EventType? type,
  2. String? siteId,
  3. String? pathname,
  4. String? hostname,
  5. String? pageTitle,
  6. String? referrer,
  7. String? userId,
  8. String? eventName,
  9. Map<String, dynamic>? properties,
  10. Map<String, String>? queryParams,
  11. String? language,
  12. int? screenWidth,
  13. int? screenHeight,
  14. String? userAgent,
  15. String? ipAddress,
})

Creates a copy of this event with the specified parameters overridden.

Implementation

TrackEvent copyWith({
  EventType? type,
  String? siteId,
  String? pathname,
  String? hostname,
  String? pageTitle,
  String? referrer,
  String? userId,
  String? eventName,
  Map<String, dynamic>? properties,
  Map<String, String>? queryParams,
  String? language,
  int? screenWidth,
  int? screenHeight,
  String? userAgent,
  String? ipAddress,
}) {
  return TrackEvent(
    type: type ?? this.type,
    siteId: siteId ?? this.siteId,
    pathname: pathname ?? this.pathname,
    hostname: hostname ?? this.hostname,
    pageTitle: pageTitle ?? this.pageTitle,
    referrer: referrer ?? this.referrer,
    userId: userId ?? this.userId,
    eventName: eventName ?? this.eventName,
    properties: properties ?? this.properties,
    queryParams: queryParams ?? this.queryParams,
    language: language ?? this.language,
    screenWidth: screenWidth ?? this.screenWidth,
    screenHeight: screenHeight ?? this.screenHeight,
    userAgent: userAgent ?? this.userAgent,
    ipAddress: ipAddress ?? this.ipAddress,
  );
}