copyWith method

NotificationEntity copyWith({
  1. String? id,
  2. String? title,
  3. String? body,
  4. Map<String, dynamic>? data,
  5. String? imageUrl,
  6. String? icon,
  7. String? channelId,
  8. DateTime? timestamp,
  9. bool? isDelivered,
  10. bool? isRead,
  11. DateTime? deliveryTime,
  12. DateTime? openedTime,
  13. NotificationSource? source,
})

Creates a copy of this notification entity with updated fields.

Implementation

NotificationEntity copyWith({
  String? id,
  String? title,
  String? body,
  Map<String, dynamic>? data,
  String? imageUrl,
  String? icon,
  String? channelId,
  DateTime? timestamp,
  bool? isDelivered,
  bool? isRead,
  DateTime? deliveryTime,
  DateTime? openedTime,
  NotificationSource? source,
}) {
  return NotificationEntity(
    id: id ?? this.id,
    title: title ?? this.title,
    body: body ?? this.body,
    data: data ?? this.data,
    imageUrl: imageUrl ?? this.imageUrl,
    icon: icon ?? this.icon,
    channelId: channelId ?? this.channelId,
    timestamp: timestamp ?? this.timestamp,
    isDelivered: isDelivered ?? this.isDelivered,
    isRead: isRead ?? this.isRead,
    deliveryTime: deliveryTime ?? this.deliveryTime,
    openedTime: openedTime ?? this.openedTime,
    source: source ?? this.source,
  );
}