copyWith method

TaskViewModel copyWith({
  1. int? id,
  2. String? title,
  3. String? description,
  4. TaskState? state,
  5. double? distance,
  6. DateTime? createdAt,
  7. DateTime? updatedAt,
  8. List<double>? location,
  9. String? locationName,
  10. List<CategoryViewModel>? categories,
  11. List<TaskGalleryPhotoViewModel>? galleryPhotos,
  12. TaskType? type,
  13. TaskFrequency? frequency,
  14. UserViewModel? user,
  15. UserViewModel? assignee,
  16. DateTime? idealDate,
  17. TaskIdealDateCompletionWhen? idealDateCompletion,
  18. bool? isInterested,
  19. bool? isSavedTask,
})

Implementation

TaskViewModel copyWith(
    {int? id,
    String? title,
    String? description,
    enums.TaskState? state,
    double? distance,
    DateTime? createdAt,
    DateTime? updatedAt,
    List<double>? location,
    String? locationName,
    List<CategoryViewModel>? categories,
    List<TaskGalleryPhotoViewModel>? galleryPhotos,
    enums.TaskType? type,
    enums.TaskFrequency? frequency,
    UserViewModel? user,
    UserViewModel? assignee,
    DateTime? idealDate,
    enums.TaskIdealDateCompletionWhen? idealDateCompletion,
    bool? isInterested,
    bool? isSavedTask}) {
  return TaskViewModel(
      id: id ?? this.id,
      title: title ?? this.title,
      description: description ?? this.description,
      state: state ?? this.state,
      distance: distance ?? this.distance,
      createdAt: createdAt ?? this.createdAt,
      updatedAt: updatedAt ?? this.updatedAt,
      location: location ?? this.location,
      locationName: locationName ?? this.locationName,
      categories: categories ?? this.categories,
      galleryPhotos: galleryPhotos ?? this.galleryPhotos,
      type: type ?? this.type,
      frequency: frequency ?? this.frequency,
      user: user ?? this.user,
      assignee: assignee ?? this.assignee,
      idealDate: idealDate ?? this.idealDate,
      idealDateCompletion: idealDateCompletion ?? this.idealDateCompletion,
      isInterested: isInterested ?? this.isInterested,
      isSavedTask: isSavedTask ?? this.isSavedTask);
}