diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 1674c43d..77a7b74e 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -9,6 +9,8 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/LaserBooking.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/components/LaserClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/doctor_post_pre_images_page.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/waiting_appointment/waiting_appointment_info.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart'; @@ -539,6 +541,8 @@ class _DoctorProfileState extends State with TickerProviderStateM if (projectViewModel.isLogin) { if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user!.age! > 12) { navigateToDentalComplaints(context); + } else if (widget.isDoctorNameSearch && widget.doctor.clinicID == 253) { + navigateToLaserClinic(context); } else { final timeSlot = DocAvailableAppointments.selectedAppoDateTime; navigateToBookConfirm(context); @@ -560,6 +564,17 @@ class _DoctorProfileState extends State with TickerProviderStateM } } + Future navigateToLaserClinic(BuildContext context) async { + HospitalsModel tempselectedHospital = new HospitalsModel(); + tempselectedHospital.iD = widget.doctor.projectID; + Navigator.push( + context, + FadePage( + page: LaserClinic(selectedHospital: tempselectedHospital!), + ), + ); + } + Future navigateToDentalComplaints(BuildContext context) async { HospitalsModel selectedHospital = new HospitalsModel(); selectedHospital.name = widget.doctor.projectName; diff --git a/lib/pages/BookAppointment/components/search_by_hospital_name.dart b/lib/pages/BookAppointment/components/search_by_hospital_name.dart index 5d0d9f9c..34b82512 100644 --- a/lib/pages/BookAppointment/components/search_by_hospital_name.dart +++ b/lib/pages/BookAppointment/components/search_by_hospital_name.dart @@ -2,6 +2,7 @@ import 'dart:collection'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/components/LaserClinic.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:flutter/material.dart'; @@ -118,15 +119,11 @@ class _SearchByHospitalState extends State { child: DropdownButtonHideUnderline( child: DropdownButton( key: projectDropdownKey, - hint: Text( - TranslationBase.of(context).selectHospital), + hint: Text(TranslationBase.of(context).selectHospital), value: selectedHospital, iconSize: 0, isExpanded: true, - style: TextStyle( - fontSize: 14, - letterSpacing: -0.56, - color: Colors.black), + style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), items: projectsList.map((HospitalsModel item) { return DropdownMenuItem( value: item, @@ -164,29 +161,16 @@ class _SearchByHospitalState extends State { mHeight(8), InkWell( onTap: () { - showClickListDialog(context, clinicIds ?? List.empty(), - onSelection: (ListClinicCentralized clincs) { + showClickListDialog(context, clinicIds ?? List.empty(), onSelection: (ListClinicCentralized clincs) { selectedClinic = clincs; Navigator.pop(context); setState(() { dropdownTitle = clincs.clinicDescription!; - dropdownValue = clincs.clinicID.toString() + - "-" + - clincs.isLiveCareClinicAndOnline.toString() + - "-" + - clincs.liveCareClinicID.toString() + - "-" + - clincs.liveCareServiceID.toString(); + dropdownValue = clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString(); }); getDoctorsList(context); - context - .read() - .analytics - .appointment - .book_appointment_select_clinic( - appointment_type: 'regular', - clinic: clincs.clinicDescription); + context.read().analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription); }); }, child: Container( @@ -302,8 +286,7 @@ class _SearchByHospitalState extends State { }); List clinicId = []; try { - Map res = await service.getClinicByHospital( - projectID: newValue?.mainProjectID.toString() ?? ""); + Map res = await service.getClinicByHospital(projectID: newValue?.mainProjectID.toString() ?? ""); GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { List list = res['ListClinic']; @@ -376,8 +359,7 @@ class _SearchByHospitalState extends State { super.dispose(); } - Future navigateToDentalComplaints( - BuildContext context, SearchInfo searchInfo) async { + Future navigateToDentalComplaints(BuildContext context, SearchInfo searchInfo) async { Navigator.push( context, FadePage( @@ -401,20 +383,10 @@ class _SearchByHospitalState extends State { List arrDistance = []; List result; int numAll; - List _patientDoctorAppointmentListHospital = - []; + List _patientDoctorAppointmentListHospital = []; DoctorsListService service = new DoctorsListService(); - service - .getDoctorsList( - clinicID, - selectedHospital?.mainProjectID.toString() != "" - ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") - : 0, - nearestAppo, - languageID, - null) - .then((res) { + service.getDoctorsList(clinicID, selectedHospital?.mainProjectID.toString() != "" ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") : 0, nearestAppo, languageID, null).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { @@ -424,27 +396,17 @@ class _SearchByHospitalState extends State { doctorsList.add(DoctorList.fromJson(v)); }); doctorsList.forEach((element) { - List doctorByHospital = - _patientDoctorAppointmentListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.getProjectCompleteName(), - ) - .toList(); + List doctorByHospital = _patientDoctorAppointmentListHospital + .where( + (elementClinic) => elementClinic.filterName == element.getProjectCompleteName(), + ) + .toList(); if (doctorByHospital.length != 0) { - _patientDoctorAppointmentListHospital[ - _patientDoctorAppointmentListHospital - .indexOf(doctorByHospital[0])] - .patientDoctorAppointmentList! - .add(element); + _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element); } else { - _patientDoctorAppointmentListHospital.add( - PatientDoctorAppointmentList( - filterName: element.getProjectCompleteName(), - distanceInKMs: - element.projectDistanceInKiloMeters.toString(), - patientDoctorAppointment: element)); + _patientDoctorAppointmentListHospital + .add(PatientDoctorAppointmentList(filterName: element.getProjectCompleteName(), distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); } }); } else {} @@ -452,8 +414,7 @@ class _SearchByHospitalState extends State { result = LinkedHashSet.from(arr).toList(); numAll = result.length; - navigateToSearchResults( - context, doctorsList, _patientDoctorAppointmentListHospital); + navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -464,20 +425,9 @@ class _SearchByHospitalState extends State { }); } - Future navigateToSearchResults( - context, - List docList, - List - patientDoctorAppointmentListHospital) async { - Navigator.push( - context, - FadePage( - page: SearchResults( - isLiveCareAppointment: false, - doctorsList: docList, - isDoctorSearchResult: false, - patientDoctorAppointmentListHospital: - patientDoctorAppointmentListHospital))) + Future navigateToSearchResults(context, List docList, List patientDoctorAppointmentListHospital) async { + Navigator.push(context, + FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, isDoctorSearchResult: false, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))) .then((value) { print("navigation return "); dropdownValue = null; @@ -493,7 +443,7 @@ class _SearchByHospitalState extends State { Navigator.push( context, FadePage( - page: LaserBooking(), + page: LaserClinic(selectedHospital: selectedHospital!), ), ).then((value) { print("LaserBooking navigation return "); @@ -534,10 +484,7 @@ class _SearchByHospitalState extends State { Navigator.push( context, FadePage( - page: LiveCareBookAppointment( - clinicName: dropdownTitle, - liveCareClinicID: dropdownValue!.split("-")[2], - liveCareServiceID: dropdownValue!.split("-")[3]), + page: LiveCareBookAppointment(clinicName: dropdownTitle, liveCareClinicID: dropdownValue!.split("-")[2], liveCareServiceID: dropdownValue!.split("-")[3]), ), ).then((value) { print("navigation return "); diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index d2bd25c3..44d06899 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -433,7 +433,8 @@ class _MyAppointmentsState extends State with SingleTickerProvid FadePage( page: AppointmentDetails( appo: _appointmentResult, - parentIndex: _currentPage, + // parentIndex: _currentPage, + parentIndex: _appointmentResult.patientStatusType == 42 ? 1 : 0, ), ), ).then((value) { diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 5ff0a7d4..717037f2 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -436,7 +436,9 @@ class PrescriptionItemsPage extends StatelessWidget { doctorID: prescriptions.doctorID!, mes: TranslationBase.of(context).sendSuc, projectID: prescriptions.projectID!, - isInOutPatient: prescriptions.isInOutPatient!); + isInOutPatient: prescriptions.isInOutPatient! + + ); }, ), );