next appointment updated.

merge-update-with-lab-changes
sultan khan 1 year ago
parent 2c746bf783
commit b93d373c6f

@ -55,7 +55,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
int selectedButtonIndex = 0; int selectedButtonIndex = 0;
int selectedNextDayButtonIndex = -1; int selectedNextDayButtonIndex = -1;
dynamic freeSlotsResponse; dynamic freeSlotsResponse;
String nextDayAppointmentDate =""; // String nextDayAppointmentDate ="";
late ScrollController _scrollController; late ScrollController _scrollController;
var language; var language;
@ -120,7 +120,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
_calendarController.selectedDate = day; _calendarController.selectedDate = day;
openTimeSlotsPickerForDate(day, docFreeSlots); openTimeSlotsPickerForDate(day, docFreeSlots);
DocAvailableAppointments.selectedDate = formatter.format(day); DocAvailableAppointments.selectedDate = formatter.format(day);
nextDayAppointmentDate = formatter.format(day.add(Duration(days: 1))); selectedNextDayButtonIndex =-1;
print(_calendarController.selectedDate); print(_calendarController.selectedDate);
}); });
} }
@ -268,7 +268,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0); DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
nextDayEvents = []; nextDayEvents = [];
DateTime? previousDate = _calendarController.selectedDate != null ? _calendarController.selectedDate : _calendarController.displayDate; // DateTime? previousDate = _calendarController.selectedDate != null ? _calendarController.selectedDate : _calendarController.displayDate;
// if(DateUtils.isSameDay(dateStart, previousDate!.add(Duration(days:1)) )) { // if(DateUtils.isSameDay(dateStart, previousDate!.add(Duration(days:1)) )) {
freeSlots.forEach((v) { freeSlots.forEach((v) {
@ -301,16 +301,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
), ),
), ),
); );
nextDayAppointmentDate = dateFormatter.format(
(isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(freeSlotsResponse[0]).add(Duration(days:1))
: DateUtil.convertStringToDateSaudiTimezone(
freeSlotsResponse[0],
int.parse(
widget.doctor.projectID.toString(),
),
).add(Duration(days:1)),
);
DocAvailableAppointments.selectedAppoDateTime = (isLiveCareSchedule != null && isLiveCareSchedule) DocAvailableAppointments.selectedAppoDateTime = (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(freeSlotsResponse[0]) ? DateUtil.convertStringToDate(freeSlotsResponse[0])
: DateUtil.convertStringToDateSaudiTimezone( : DateUtil.convertStringToDateSaudiTimezone(
@ -386,16 +377,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
selectedNextDayButtonIndex =-1; selectedNextDayButtonIndex =-1;
DocAvailableAppointments.selectedTime = dayEvents[index].isoTime; DocAvailableAppointments.selectedTime = dayEvents[index].isoTime;
print(DocAvailableAppointments.selectedTime); print(DocAvailableAppointments.selectedTime);
DocAvailableAppointments.selectedDate = dateFormatter.format( DocAvailableAppointments.selectedDate = dateFormatter.format(_calendarController.selectedDate!);
(isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(freeSlotsResponse[0])
: DateUtil.convertStringToDateSaudiTimezone(
freeSlotsResponse[0],
int.parse(
widget.doctor.projectID.toString(),
),
),
);
}); });
projectViewModel.analytics.appointment.book_appointment_time_selection(appointment_type: 'regular', dateTime: timeslot.end, doctor: widget.doctor); projectViewModel.analytics.appointment.book_appointment_time_selection(appointment_type: 'regular', dateTime: timeslot.end, doctor: widget.doctor);
}, },
@ -416,16 +399,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
setState(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
DocAvailableAppointments.selectedTime = dayEvents[index].isoTime; DocAvailableAppointments.selectedTime = dayEvents[index].isoTime;
DocAvailableAppointments.selectedDate = dateFormatter.format( DocAvailableAppointments.selectedDate = dateFormatter.format(_calendarController.selectedDate!);
(isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(freeSlotsResponse[0])
: DateUtil.convertStringToDateSaudiTimezone(
freeSlotsResponse[0],
int.parse(
widget.doctor.projectID.toString(),
),
),
);
print(DocAvailableAppointments.selectedTime); print(DocAvailableAppointments.selectedTime);
}); });
}, },
@ -449,7 +423,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
selectedButtonIndex = -1; selectedButtonIndex = -1;
selectedNextDayButtonIndex =index; selectedNextDayButtonIndex =index;
DocAvailableAppointments.selectedTime = nextDayEvents[index].isoTime; DocAvailableAppointments.selectedTime = nextDayEvents[index].isoTime;
DocAvailableAppointments.selectedDate = nextDayAppointmentDate; DocAvailableAppointments.selectedDate = dateFormatter.format(_calendarController.selectedDate!.add(Duration(days:1)));
print(DocAvailableAppointments.selectedTime); print(DocAvailableAppointments.selectedTime);
}); });
projectViewModel.analytics.appointment.book_appointment_time_selection(appointment_type: 'regular', dateTime: timeslot.end, doctor: widget.doctor); projectViewModel.analytics.appointment.book_appointment_time_selection(appointment_type: 'regular', dateTime: timeslot.end, doctor: widget.doctor);
@ -472,7 +446,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
selectedButtonIndex =-1; selectedButtonIndex =-1;
selectedNextDayButtonIndex = index; selectedNextDayButtonIndex = index;
DocAvailableAppointments.selectedTime = nextDayEvents[index].isoTime; DocAvailableAppointments.selectedTime = nextDayEvents[index].isoTime;
DocAvailableAppointments.selectedDate = nextDayAppointmentDate; DocAvailableAppointments.selectedDate =dateFormatter.format(_calendarController.selectedDate!.add(Duration(days:1)));
print(DocAvailableAppointments.selectedTime); print(DocAvailableAppointments.selectedTime);
}); });
}, },

Loading…
Cancel
Save