copyWith method

ExperimentUser copyWith({
  1. String? deviceId,
  2. String? userId,
  3. String? country,
  4. String? city,
  5. String? region,
  6. String? dma,
  7. String? language,
  8. String? platform,
  9. String? version,
  10. String? os,
  11. String? deviceModel,
  12. String? deviceBrand,
  13. String? deviceManufacturer,
  14. String? carrier,
  15. String? library,
  16. String? ipAddress,
  17. Map<String, Object?>? userProperties,
  18. Map<String, List<String>>? groups,
  19. Map<String, Map<String, Map<String, Object?>>>? groupProperties,
})

Returns a copy of this user with the given fields replaced.

Fields that are not provided retain their current values.

Implementation

ExperimentUser copyWith({
  String? deviceId,
  String? userId,
  String? country,
  String? city,
  String? region,
  String? dma,
  String? language,
  String? platform,
  String? version,
  String? os,
  String? deviceModel,
  String? deviceBrand,
  String? deviceManufacturer,
  String? carrier,
  String? library,
  String? ipAddress,
  Map<String, Object?>? userProperties,
  Map<String, List<String>>? groups,
  Map<String, Map<String, Map<String, Object?>>>? groupProperties,
}) {
  return ExperimentUser(
    deviceId: deviceId ?? this.deviceId,
    userId: userId ?? this.userId,
    country: country ?? this.country,
    city: city ?? this.city,
    region: region ?? this.region,
    dma: dma ?? this.dma,
    language: language ?? this.language,
    platform: platform ?? this.platform,
    version: version ?? this.version,
    os: os ?? this.os,
    deviceModel: deviceModel ?? this.deviceModel,
    deviceBrand: deviceBrand ?? this.deviceBrand,
    deviceManufacturer: deviceManufacturer ?? this.deviceManufacturer,
    carrier: carrier ?? this.carrier,
    library: library ?? this.library,
    ipAddress: ipAddress ?? this.ipAddress,
    userProperties: userProperties ?? this.userProperties,
    groups: groups ?? this.groups,
    groupProperties: groupProperties ?? this.groupProperties,
  );
}