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. TaskType? type,
  12. TaskFrequency? frequency,
  13. UserViewModel? user,
  14. UserViewModel? assignee,
  15. DateTime? idealDate,
  16. TaskIdealDateCompletionWhen? idealDateCompletion,
  17. bool? isInterested,
})

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,
    enums.TaskType? type,
    enums.TaskFrequency? frequency,
    UserViewModel? user,
    UserViewModel? assignee,
    DateTime? idealDate,
    enums.TaskIdealDateCompletionWhen? idealDateCompletion,
    bool? isInterested}) {
  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,
      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);
}