copyWith method

BackgroundJob copyWith({
  1. int? id,
  2. String? jobKey,
  3. Map<String, dynamic>? payload,
  4. BackgroundJobStatus? status,
  5. int? attempts,
  6. int? maxAttempts,
  7. DateTime? lastAttemptAt,
  8. String? lastError,
  9. int? priority,
  10. DateTime? createdAt,
  11. DateTime? updatedAt,
})

Implementation

BackgroundJob copyWith({
  int? id,
  String? jobKey,
  Map<String, dynamic>? payload,
  BackgroundJobStatus? status,
  int? attempts,
  int? maxAttempts,
  DateTime? lastAttemptAt,
  String? lastError,
  int? priority,
  DateTime? createdAt,
  DateTime? updatedAt,
}) {
  return BackgroundJob(
    id: id ?? this.id,
    jobKey: jobKey ?? this.jobKey,
    payload: payload ?? this.payload,
    status: status ?? this.status,
    attempts: attempts ?? this.attempts,
    maxAttempts: maxAttempts ?? this.maxAttempts,
    lastAttemptAt: lastAttemptAt ?? this.lastAttemptAt,
    lastError: lastError ?? this.lastError,
    priority: priority ?? this.priority,
    createdAt: createdAt ?? this.createdAt,
    updatedAt: updatedAt ?? this.updatedAt,
  );
}