|
|
|
|
@ -55,7 +55,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
|
|
|
|
|
int selectedButtonIndex = 0;
|
|
|
|
|
int selectedNextDayButtonIndex = -1;
|
|
|
|
|
dynamic freeSlotsResponse;
|
|
|
|
|
String nextDayAppointmentDate ="";
|
|
|
|
|
// String nextDayAppointmentDate ="";
|
|
|
|
|
late ScrollController _scrollController;
|
|
|
|
|
|
|
|
|
|
var language;
|
|
|
|
|
@ -120,7 +120,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
|
|
|
|
|
_calendarController.selectedDate = day;
|
|
|
|
|
openTimeSlotsPickerForDate(day, docFreeSlots);
|
|
|
|
|
DocAvailableAppointments.selectedDate = formatter.format(day);
|
|
|
|
|
nextDayAppointmentDate = formatter.format(day.add(Duration(days: 1)));
|
|
|
|
|
selectedNextDayButtonIndex =-1;
|
|
|
|
|
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);
|
|
|
|
|
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)) )) {
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
? DateUtil.convertStringToDate(freeSlotsResponse[0])
|
|
|
|
|
: DateUtil.convertStringToDateSaudiTimezone(
|
|
|
|
|
@ -386,16 +377,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
|
|
|
|
|
selectedNextDayButtonIndex =-1;
|
|
|
|
|
DocAvailableAppointments.selectedTime = dayEvents[index].isoTime;
|
|
|
|
|
print(DocAvailableAppointments.selectedTime);
|
|
|
|
|
DocAvailableAppointments.selectedDate = dateFormatter.format(
|
|
|
|
|
(isLiveCareSchedule != null && isLiveCareSchedule)
|
|
|
|
|
? DateUtil.convertStringToDate(freeSlotsResponse[0])
|
|
|
|
|
: DateUtil.convertStringToDateSaudiTimezone(
|
|
|
|
|
freeSlotsResponse[0],
|
|
|
|
|
int.parse(
|
|
|
|
|
widget.doctor.projectID.toString(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
DocAvailableAppointments.selectedDate = dateFormatter.format(_calendarController.selectedDate!);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
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(() {
|
|
|
|
|
selectedButtonIndex = index;
|
|
|
|
|
DocAvailableAppointments.selectedTime = dayEvents[index].isoTime;
|
|
|
|
|
DocAvailableAppointments.selectedDate = dateFormatter.format(
|
|
|
|
|
(isLiveCareSchedule != null && isLiveCareSchedule)
|
|
|
|
|
? DateUtil.convertStringToDate(freeSlotsResponse[0])
|
|
|
|
|
: DateUtil.convertStringToDateSaudiTimezone(
|
|
|
|
|
freeSlotsResponse[0],
|
|
|
|
|
int.parse(
|
|
|
|
|
widget.doctor.projectID.toString(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
DocAvailableAppointments.selectedDate = dateFormatter.format(_calendarController.selectedDate!);
|
|
|
|
|
print(DocAvailableAppointments.selectedTime);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
@ -449,7 +423,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
|
|
|
|
|
selectedButtonIndex = -1;
|
|
|
|
|
selectedNextDayButtonIndex =index;
|
|
|
|
|
DocAvailableAppointments.selectedTime = nextDayEvents[index].isoTime;
|
|
|
|
|
DocAvailableAppointments.selectedDate = nextDayAppointmentDate;
|
|
|
|
|
DocAvailableAppointments.selectedDate = dateFormatter.format(_calendarController.selectedDate!.add(Duration(days:1)));
|
|
|
|
|
print(DocAvailableAppointments.selectedTime);
|
|
|
|
|
});
|
|
|
|
|
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;
|
|
|
|
|
selectedNextDayButtonIndex = index;
|
|
|
|
|
DocAvailableAppointments.selectedTime = nextDayEvents[index].isoTime;
|
|
|
|
|
DocAvailableAppointments.selectedDate = nextDayAppointmentDate;
|
|
|
|
|
DocAvailableAppointments.selectedDate =dateFormatter.format(_calendarController.selectedDate!.add(Duration(days:1)));
|
|
|
|
|
print(DocAvailableAppointments.selectedTime);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|