|
|
|
|
@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.
|
|
|
|
|
import 'package:diplomaticquarterapp/models/header_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/waiting_appointment/waiting_appointment_info.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
|
|
|
|
@ -299,10 +300,52 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void goToBookConfirm() {
|
|
|
|
|
if (DocAvailableAppointments.areSlotsAvailable)
|
|
|
|
|
navigateToBookConfirm(context);
|
|
|
|
|
else
|
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
|
|
|
|
|
if (DocAvailableAppointments.selectedTime == TranslationBase.of(context).waitingAppointment) {
|
|
|
|
|
canPayForWalkInAppointment();
|
|
|
|
|
} else {
|
|
|
|
|
if (DocAvailableAppointments.areSlotsAvailable)
|
|
|
|
|
navigateToBookConfirm(context);
|
|
|
|
|
else
|
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
canPayForWalkInAppointment() {
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
service.canPayForWalkInAppointment(widget.appo.projectID!, widget.appo.clinicID!, widget.appo.doctorID!).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
navigateToWaitingAppointment(context);
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future navigateToWaitingAppointment(context) async {
|
|
|
|
|
DoctorList doctor = new DoctorList();
|
|
|
|
|
doctor.name = widget.appo.doctorNameObj;
|
|
|
|
|
doctor.clinicID = widget.appo.clinicID;
|
|
|
|
|
doctor.projectID = widget.appo.projectID;
|
|
|
|
|
doctor.doctorID = widget.appo.doctorID;
|
|
|
|
|
doctor.clinicName = widget.appo.clinicName;
|
|
|
|
|
doctor.projectName = widget.appo.projectName;
|
|
|
|
|
doctor.doctorTitle = widget.appo.doctorTitle;
|
|
|
|
|
doctor.doctorImageURL = widget.appo.doctorImageURL;
|
|
|
|
|
doctor.speciality = widget.appo.doctorSpeciality;
|
|
|
|
|
doctor.nationalityFlagURL = "";
|
|
|
|
|
doctor.doctorRate = widget.appo.doctorRate;
|
|
|
|
|
doctor.noOfPatientsRate = widget.appo.noOfPatientsRate;
|
|
|
|
|
|
|
|
|
|
projectViewModel?.setWaitingAppointmentProjectID(widget.appo.projectID!);
|
|
|
|
|
projectViewModel?.setWaitingAppointmentDoctor(doctor);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: WaitingAppointmentInfo(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future navigateToBookConfirm(context) async {
|
|
|
|
|
|