copyWith method

CustomAdModel copyWith({
  1. String? id,
  2. String? title,
  3. String? description,
  4. String? imageUrl,
  5. String? link,
  6. String? callToAction,
  7. String? advertiser,
  8. double? rating,
  9. VoidCallback? onTap,
  10. Map<String, dynamic>? extras,
})

Creates a copy of this CustomAdModel with updated fields.

Implementation

CustomAdModel copyWith({
  String? id,
  String? title,
  String? description,
  String? imageUrl,
  String? link,
  String? callToAction,
  String? advertiser,
  double? rating,
  VoidCallback? onTap,
  Map<String, dynamic>? extras,
}) {
  return CustomAdModel(
    id: id ?? this.id,
    title: title ?? this.title,
    description: description ?? this.description,
    imageUrl: imageUrl ?? this.imageUrl,
    link: link ?? this.link,
    callToAction: callToAction ?? this.callToAction,
    advertiser: advertiser ?? this.advertiser,
    rating: rating ?? this.rating,
    onTap: onTap ?? this.onTap,
    extras: extras ?? this.extras,
  );
}