copyWith method

DoctorDetailsState copyWith({
  1. List<Document>? allDoctors,
  2. List<Document>? filteredDoctors,
  3. DateTime? fromDate,
  4. DateTime? tillDate,
  5. bool? isLoading,
  6. String? error,
})

Returns a copy of this state with updated fields if provided.

Implementation

DoctorDetailsState copyWith({
  List<models.Document>? allDoctors,
  List<models.Document>? filteredDoctors,
  DateTime? fromDate,
  DateTime? tillDate,
  bool? isLoading,
  String? error,
}) {
  return DoctorDetailsState(
    allDoctors: allDoctors ?? this.allDoctors,
    filteredDoctors: filteredDoctors ?? this.filteredDoctors,
    fromDate: fromDate ?? this.fromDate,
    tillDate: tillDate ?? this.tillDate,
    isLoading: isLoading ?? this.isLoading,
    error: error,
  );
}