From fb9a4d52972350d09c48d00ddc6b798d55182036 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 24 Aug 2023 10:36:07 +0300 Subject: [PATCH] Laser clinic changes --- lib/pages/BookAppointment/components/LaserClinic.dart | 7 +++++-- lib/pages/BookAppointment/components/SearchByClinic.dart | 8 +++----- lib/services/appointment_services/GetDoctorsList.dart | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/pages/BookAppointment/components/LaserClinic.dart b/lib/pages/BookAppointment/components/LaserClinic.dart index 04db5bed..918ca9ad 100644 --- a/lib/pages/BookAppointment/components/LaserClinic.dart +++ b/lib/pages/BookAppointment/components/LaserClinic.dart @@ -1,5 +1,6 @@ import 'dart:collection'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; @@ -17,7 +18,9 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LaserClinic extends StatefulWidget { - LaserClinic({Key key}) : super(key: key); + HospitalsModel selectedHospital; + + LaserClinic({this.selectedHospital}); @override _LaserClinicState createState() { @@ -66,7 +69,7 @@ class _LaserClinicState extends State with SingleTickerProviderStat GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getLaserBodyPartsList(laserCategoryId).then((res) { + service.getLaserBodyPartsList(laserCategoryId, widget.selectedHospital.iD).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['Laser_GetBodyPartsByCategoryList'].length != 0) { diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 8dbfe320..dc126e78 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -240,7 +240,7 @@ class _SearchByClinicState extends State { dropdownValue = clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString(); if (dropdownValue == "253-false-0-0") { - Navigator.push(context, FadePage(page: LaserClinic())); + // Navigator.push(context, FadePage(page: LaserClinic())); } else if (!isDentalSelectedAndSupported()) { projectDropdownValue = ""; if (!nearestAppo) getDoctorsList(context); @@ -333,7 +333,7 @@ class _SearchByClinicState extends State { selectedHospital = newValue; projectDropdownValue = newValue.mainProjectID.toString(); if (dropdownValue.split("-")[0] == "253") { - Navigator.push(context, FadePage(page: LaserClinic())); + Navigator.push(context, FadePage(page: LaserClinic(selectedHospital: selectedHospital))); } else { getDoctorsList(context); } @@ -461,9 +461,7 @@ class _SearchByClinicState extends State { bool isDentalSelectedAndSupported() { if (dropdownValue != null) - return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" - // || dropdownValue.split("-")[0] == "253" - ) && isMobileAppDentalAllow; + return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" || dropdownValue.split("-")[0] == "253") && isMobileAppDentalAllow; else return false; } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 9fa1ac3c..7d97239c 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1612,11 +1612,12 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getLaserBodyPartsList(int laserCategoryID) async { + Future getLaserBodyPartsList(int laserCategoryID, int projectID) async { Map request; request = { "LaserCategoryID": laserCategoryID, + "ProjectID": projectID, }; dynamic localRes; await baseAppClient.post(LASER_BODY_PARTS, onSuccess: (response, statusCode) async {