|
|
|
@ -49,6 +49,8 @@ class BookAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
|
|
int initialSlotDuration = 0;
|
|
|
|
int initialSlotDuration = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isNearestAppointmentSelected = false;
|
|
|
|
|
|
|
|
|
|
|
|
LocationUtils locationUtils;
|
|
|
|
LocationUtils locationUtils;
|
|
|
|
|
|
|
|
|
|
|
|
List<GetClinicsListResponseModel> clinicsList = [];
|
|
|
|
List<GetClinicsListResponseModel> clinicsList = [];
|
|
|
|
@ -187,6 +189,18 @@ class BookAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setIsNearestAppointmentSelected(bool isNearestAppointmentSelected) {
|
|
|
|
|
|
|
|
this.isNearestAppointmentSelected = isNearestAppointmentSelected;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isNearestAppointmentSelected) {
|
|
|
|
|
|
|
|
doctorsList.sort((a, b) => DateUtil.convertStringToDate(a.nearestFreeSlot!).compareTo(DateUtil.convertStringToDate(b.nearestFreeSlot!)));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
doctorsList.sort((a, b) => b.decimalDoctorRate!.compareTo(a.decimalDoctorRate!));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setIsWaitingAppointmentSelected(bool isWaitingAppointmentSelected) {
|
|
|
|
setIsWaitingAppointmentSelected(bool isWaitingAppointmentSelected) {
|
|
|
|
this.isWaitingAppointmentSelected = isWaitingAppointmentSelected;
|
|
|
|
this.isWaitingAppointmentSelected = isWaitingAppointmentSelected;
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
@ -391,6 +405,7 @@ class BookAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
doctorsList = apiResponse.data!;
|
|
|
|
doctorsList = apiResponse.data!;
|
|
|
|
filteredDoctorList = doctorsList;
|
|
|
|
filteredDoctorList = doctorsList;
|
|
|
|
isDoctorsListLoading = false;
|
|
|
|
isDoctorsListLoading = false;
|
|
|
|
|
|
|
|
doctorsList.sort((a, b) => b.decimalDoctorRate!.compareTo(a.decimalDoctorRate!));
|
|
|
|
initializeFilteredList();
|
|
|
|
initializeFilteredList();
|
|
|
|
clearSearchFilters();
|
|
|
|
clearSearchFilters();
|
|
|
|
getFiltersFromDoctorList();
|
|
|
|
getFiltersFromDoctorList();
|
|
|
|
|