copyWith method

AdItem copyWith({
  1. String? adId,
  2. String? campaignId,
  3. String? id,
  4. String? imageUrl,
  5. String? clickUrl,
  6. String? ttl,
  7. bool? isViewed,
  8. String? type,
  9. int? priority,
  10. int? impressionCount,
  11. Map<String, dynamic>? action,
})

Create a copy with updated fields

Implementation

AdItem copyWith({
  String? adId,
  String? campaignId,
  String? id,
  String? imageUrl,
  String? clickUrl,
  String? ttl,
  bool? isViewed,
  String? type,
  int? priority,
  int? impressionCount,
  Map<String, dynamic>? action,
}) {
  return AdItem(
    adId: adId ?? this.adId,
    campaignId: campaignId ?? this.campaignId,
    id: id ?? this.id,
    imageUrl: imageUrl ?? this.imageUrl,
    clickUrl: clickUrl ?? this.clickUrl,
    ttl: ttl ?? this.ttl,
    isViewed: isViewed ?? this.isViewed,
    type: type ?? this.type,
    priority: priority ?? this.priority,
    impressionCount: impressionCount ?? this.impressionCount,
    action: action ?? this.action,
  );
}