copyWith method

NotificationPayload copyWith({
  1. String? title,
  2. String? body,
  3. String? imageUrl,
  4. String? route,
  5. Map<String, dynamic>? data,
  6. List<NotificationAction>? actions,
  7. int? id,
  8. String? channelId,
  9. String? category,
  10. String? sound,
  11. int? badge,
  12. int? ttl,
  13. String? priority,
})

Creates a copy of this payload with the given fields replaced.

Implementation

NotificationPayload copyWith({
  String? title,
  String? body,
  String? imageUrl,
  String? route,
  Map<String, dynamic>? data,
  List<NotificationAction>? actions,
  int? id,
  String? channelId,
  String? category,
  String? sound,
  int? badge,
  int? ttl,
  String? priority,
}) {
  return NotificationPayload(
    title: title ?? this.title,
    body: body ?? this.body,
    imageUrl: imageUrl ?? this.imageUrl,
    route: route ?? this.route,
    data: data ?? this.data,
    actions: actions ?? this.actions,
    id: id ?? this.id,
    channelId: channelId ?? this.channelId,
    category: category ?? this.category,
    sound: sound ?? this.sound,
    badge: badge ?? this.badge,
    ttl: ttl ?? this.ttl,
    priority: priority ?? this.priority,
  );
}