|
|
|
|
@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/header_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
|
@ -41,7 +42,10 @@ class BookConfirm extends StatefulWidget {
|
|
|
|
|
bool isLiveCareAppointment;
|
|
|
|
|
int initialSlotDuration;
|
|
|
|
|
|
|
|
|
|
BookConfirm({required this.doctor, required this.selectedDate, required this.isLiveCareAppointment, required this.selectedTime, required this.initialSlotDuration});
|
|
|
|
|
bool isWalkinAppointment = false;
|
|
|
|
|
|
|
|
|
|
BookConfirm(
|
|
|
|
|
{required this.doctor, required this.selectedDate, required this.isLiveCareAppointment, required this.selectedTime, required this.initialSlotDuration, required this.isWalkinAppointment});
|
|
|
|
|
|
|
|
|
|
late DoctorsListService service;
|
|
|
|
|
late PatientShareResponse patientShareResponse;
|
|
|
|
|
@ -212,10 +216,14 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
elevation: 0,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false;
|
|
|
|
|
if (isLiveCareSchedule) {
|
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
|
if (widget.isWalkinAppointment) {
|
|
|
|
|
getWalkinAppointmentPatientShare();
|
|
|
|
|
} else {
|
|
|
|
|
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
|
|
|
|
|
if (isLiveCareSchedule) {
|
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
|
} else {
|
|
|
|
|
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)),
|
|
|
|
|
@ -226,6 +234,39 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openPaymentDialog(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) {
|
|
|
|
|
showGeneralDialog(
|
|
|
|
|
barrierColor: Colors.black.withOpacity(0.5),
|
|
|
|
|
transitionBuilder: (context, a1, a2, widget) {
|
|
|
|
|
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
|
|
|
|
|
return Transform(
|
|
|
|
|
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
|
|
|
|
|
child: Opacity(
|
|
|
|
|
opacity: a1.value,
|
|
|
|
|
child: PaymentDialog(
|
|
|
|
|
appo: appo,
|
|
|
|
|
patientShareResponse: patientShareResponse,
|
|
|
|
|
isCashPatient: isCash,
|
|
|
|
|
onPaymentMethodSelected: () {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
transitionDuration: Duration(milliseconds: 500),
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
barrierLabel: '',
|
|
|
|
|
context: context,
|
|
|
|
|
pageBuilder: (context, animation1, animation2) => SizedBox()).then((value) {
|
|
|
|
|
print(value);
|
|
|
|
|
if (value != null) {
|
|
|
|
|
// navigateToPaymentMethod(context, value as PatientShareResponse, appo);
|
|
|
|
|
// projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo);
|
|
|
|
|
} else {
|
|
|
|
|
// projectViewModel.analytics.todoList.to_do_list_cancel_payment_details(appo);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget showInfo(String title, String des) {
|
|
|
|
|
return Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
@ -253,6 +294,25 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getWalkinAppointmentPatientShare() {
|
|
|
|
|
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
appo.doctorTitle = widget.doctor.doctorTitle;
|
|
|
|
|
appo.doctorNameObj = widget.doctor.name;
|
|
|
|
|
appo.appointmentDate = DateUtil.convertDateToString(DateTime.now());
|
|
|
|
|
appo.projectName = widget.doctor.projectName;
|
|
|
|
|
|
|
|
|
|
widget.service.getLiveCareAppointmentPatientShare("2016068106", 601, 15, projectViewModel.isArabic ? 1 : 2, context).then((res) {
|
|
|
|
|
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
openPaymentDialog(appo, widget.patientShareResponse!);
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) async {
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context);
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
|
|
|
|
|
|