From ec13edc28b7c3d04badf8df554c13c72374fe1cf Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Wed, 8 Nov 2023 10:37:04 +0300 Subject: [PATCH] updates. --- .../AppoimentAllHistoryResultList.dart | 48 +++++++++---------- .../SmartWatch/YearlyHeartRateResModel.dart | 2 +- .../all_habib_medical_service_page.dart | 2 +- .../bmr_calculator/bmr_calculator.dart | 2 +- .../calorie_calculator.dart | 14 ++++-- .../health_calculator/carbs/carbs.dart | 2 + .../ideal_body/ideal_body.dart | 2 +- .../BookAppointment/widgets/DoctorView.dart | 4 +- .../covid-drivethru-location.dart | 15 +++--- lib/pages/feedback/send_feedback_page.dart | 29 +++++------ lib/pages/landing/widgets/services_view.dart | 2 +- lib/uitl/app_toast.dart | 4 +- lib/uitl/location_util.dart | 4 +- .../others/floating_button_search.dart | 2 +- 14 files changed, 72 insertions(+), 60 deletions(-) diff --git a/lib/models/Appointments/AppoimentAllHistoryResultList.dart b/lib/models/Appointments/AppoimentAllHistoryResultList.dart index fd8bd3b7..ac37f555 100644 --- a/lib/models/Appointments/AppoimentAllHistoryResultList.dart +++ b/lib/models/Appointments/AppoimentAllHistoryResultList.dart @@ -1,24 +1,24 @@ class AppoitmentAllHistoryResultList { String? setupID; - int? projectID; - int? appointmentNo; + dynamic? projectID; + dynamic? appointmentNo; String? appointmentDate; - dynamic appointmentDateN; - int? appointmentType; + dynamic? appointmentDateN; + dynamic? appointmentType; String? bookDate; - int? patientType; - int? patientID; - int? clinicID; - int? doctorID; + dynamic? patientType; + dynamic? patientID; + dynamic? clinicID; + dynamic? doctorID; String? endDate; String? startTime; String? endTime; - int? status; - int? visitType; - int? visitFor; - int? patientStatusType; - int? companyID; - int? bookedBy; + dynamic? status; + dynamic? visitType; + dynamic? visitFor; + dynamic? patientStatusType; + dynamic? companyID; + dynamic? bookedBy; String? bookedOn; dynamic confirmedBy; dynamic confirmedOn; @@ -32,24 +32,24 @@ class AppoitmentAllHistoryResultList { dynamic statusDescN; bool? vitalStatus; dynamic vitalSignAppointmentNo; - int? episodeID; - int? actualDoctorRate; + dynamic? episodeID; + dynamic? actualDoctorRate; String? clinicName; bool? complainExists; String? doctorImageURL; String? doctorNameObj; - int? doctorRate; + dynamic? doctorRate; dynamic decimalDoctorRate; List? doctorSpeciality; String? doctorTitle; - int? gender; + dynamic? gender; String? genderDescription; bool? iSAllowOnlineCheckedIN; bool? isActiveDoctor; bool? isActiveDoctorProfile; bool? isDoctorAllowVedioCall; bool? isExecludeDoctor; - int? isFollowup; + dynamic? isFollowup; bool? isLiveCareAppointment; bool? isInOutPatient; bool? isMedicalReportRequested; @@ -58,15 +58,15 @@ class AppoitmentAllHistoryResultList { dynamic listHISGetContactLensPerscription; dynamic listHISGetGlassPerscription; String? longitude; - int? nextAction; - int? noOfPatientsRate; - int? originalClinicID; - int? originalProjectID; + dynamic? nextAction; + dynamic? noOfPatientsRate; + dynamic? originalClinicID; + dynamic? originalProjectID; String? projectName; String? qR; int? remaniningHoursTocanPay; bool? sMSButtonVisable; - int? serviceID; + dynamic? serviceID; AppoitmentAllHistoryResultList( {this.setupID, diff --git a/lib/models/SmartWatch/YearlyHeartRateResModel.dart b/lib/models/SmartWatch/YearlyHeartRateResModel.dart index 2e751ee8..331d5adb 100644 --- a/lib/models/SmartWatch/YearlyHeartRateResModel.dart +++ b/lib/models/SmartWatch/YearlyHeartRateResModel.dart @@ -1,5 +1,5 @@ class YearlyHeartRateResModel { - num? valueAvg; + dynamic? valueAvg; int? medCategoryID; int? month; String? monthName; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 719b7851..c12aa36a 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -356,7 +356,7 @@ class _AllHabibMedicalServiceState extends State { Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => MyWebView( title: "HMG News", - selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + selectedUrl: " https://twitter.com/HMG", //"https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", //this url is not working so changed to the hmg ))); }, imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart index fbd0dffb..7d373462 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart @@ -138,7 +138,7 @@ class _BmrCalculatorState extends State { @override Widget build(BuildContext context) { - if (dropdownValue == null) dropdownValue = TranslationBase.of(context).lightActive1; + dropdownValue = TranslationBase.of(context).lightActive1; ProjectViewModel projectViewModel = Provider.of(context); _weightPopupList = [PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)]; _heightPopupList = [PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)]; diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart index ca5bb4e0..54229a54 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -44,8 +44,14 @@ class _CalorieCalculatorState extends State { // int height = 0; // int weight = 0; double? calories; - String dropdownValue = ''; + String? dropdownValue = ''; + @override + void initState() { + + + super.initState(); + } void updateColor(int type) { //MG/DLT card if (type == 1) { @@ -74,12 +80,14 @@ class _CalorieCalculatorState extends State { } } + + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); _weightPopupList = [PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)]; _heightPopupList = [PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)]; - + dropdownValue= TranslationBase.of(context).almostInactive; return AppScaffold( isShowAppBar: true, isShowDecPage: false, @@ -288,7 +296,7 @@ class _CalorieCalculatorState extends State { height: 18, child: DropdownButtonHideUnderline( child: DropdownButton( - value: dropdownValue, + value:dropdownValue, key: clinicDropdownKey, icon: Icon(Icons.arrow_downward), iconSize: 0, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart index 168b1164..5ee8980f 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -83,6 +83,8 @@ class _CarbsState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + + dropdownValue = TranslationBase.of(context).dietVeryLow; return AppScaffold( isShowAppBar: true, isShowDecPage: false, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart index 6c63eed7..991368d5 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -85,7 +85,7 @@ class _IdealBodyState extends State { @override Widget build(BuildContext context) { - if (dropdownValue == null) dropdownValue = TranslationBase.of(context).mediumFinger; + dropdownValue = TranslationBase.of(context).mediumFinger; _weightPopupList = [PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)]; _heightPopupList = [PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)]; diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 372a1861..a7fe8a4d 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -87,10 +87,10 @@ class DoctorView extends StatelessWidget { style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), - Text( + doctor.date ==null ? SizedBox() : Text( DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date)), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), - ), + ) , ], ), if (doctor.doctorTitle != null) SizedBox(height: 6), diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 74023677..2c0c1164 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -37,7 +37,7 @@ class _CovidDrivethruLocationState extends State { String projectID = ""; List imagesInfo = []; - DriveThroughTestingCenterModel selectedProject = DriveThroughTestingCenterModel(); + DriveThroughTestingCenterModel? selectedProject; final GlobalKey locationDropdownKey = GlobalKey(); late ProjectViewModel projectViewModel; @@ -109,6 +109,7 @@ class _CovidDrivethruLocationState extends State { Container( height: 20, child: DropdownButtonHideUnderline( + //Dropdown duplicate issue child: DropdownButton( onTap: () { print("Clicked"); @@ -117,7 +118,7 @@ class _CovidDrivethruLocationState extends State { hint: new Text( TranslationBase.of(context).selectAddress, ), - value: selectedProject, + value:selectedProject ==null || selectedProject!.projectName.isNotEmpty ?selectedProject :null, iconSize: 0, isExpanded: true, style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), @@ -126,7 +127,7 @@ class _CovidDrivethruLocationState extends State { value: item, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Text(item.projectName ?? ""), getCovidTestTypeImage(item)], + children: [Text(item.projectName==null ? "" : item.projectName), getCovidTestTypeImage(item)], ), ); }).toList(), @@ -277,7 +278,7 @@ class _CovidDrivethruLocationState extends State { next() { if (isLocationSelected) { - Navigator.push(context, FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList, selectedProject: selectedProject))); + Navigator.push(context, FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList, selectedProject: selectedProject!))); } else { Utils.showErrorToast("Please select address from the dropdown menu to continue"); } @@ -302,7 +303,7 @@ class _CovidDrivethruLocationState extends State { CovidDriveThruService service = new CovidDriveThruService(); CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); GifLoaderDialogUtils.showMyDialog(context); - service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID!, selectedProject.testTypeEnum!, selectedProject.testProcedureEnum!).then((res) { + service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID!, selectedProject!.testTypeEnum!, selectedProject!.testProcedureEnum!).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { @@ -315,7 +316,7 @@ class _CovidDrivethruLocationState extends State { covidPaymentInfoResponse: covidPaymentInfoResponse, projectID: int.parse(projectID), proceduresList: proceduresList, - selectedProject: selectedProject, + selectedProject: selectedProject!, ))); } else {} }).catchError((err) { @@ -327,7 +328,7 @@ class _CovidDrivethruLocationState extends State { CovidDriveThruService service = new CovidDriveThruService(); GifLoaderDialogUtils.showMyDialog(context); - service.getCovidTestProceduresList(context, selectedProject.testTypeEnum!, selectedProject.testProcedureEnum!, selectedProject.projectID!).then((res) { + service.getCovidTestProceduresList(context, selectedProject!.testTypeEnum!, selectedProject!.testProcedureEnum!, selectedProject!.projectID!).then((res) { if (res['MessageStatus'] == 1) { setState(() { res['COVID19_TestProceduresList'].forEach((v) { diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index d6c5039c..3c320d76 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -44,7 +44,7 @@ class _SendFeedbackPageState extends State { TextEditingController messageController = TextEditingController(); List images = []; late String title; - AppoitmentAllHistoryResultList appointHistory = AppoitmentAllHistoryResultList(); + AppoitmentAllHistoryResultList? appointHistory = AppoitmentAllHistoryResultList(); bool isShowListAppointHistory = true; String message = ""; final formKey = GlobalKey(); @@ -82,10 +82,11 @@ class _SendFeedbackPageState extends State { return TranslationBase.of(context).notClassified; } - setMessageType(MessageType messageType) { + setMessageType(MessageType messageType,AppoitmentAllHistoryResultList? appointHistory) { + print(widget); setState(() { this.messageType = messageType; - this.appointHistory = widget.appointment!; + this.appointHistory = appointHistory; }); } @@ -93,7 +94,7 @@ class _SendFeedbackPageState extends State { void initState() { setState(() { this.messageType = widget.messageType; - this.appointHistory = widget.appointment ?? AppoitmentAllHistoryResultList(); + this.appointHistory = widget.appointment; }); // requestPermissions(); event.controller.stream.listen((p) { @@ -177,15 +178,15 @@ class _SendFeedbackPageState extends State { }, child: DoctorCard( onTap: null, - isInOutPatient: appointHistory.isInOutPatient, - name: appointHistory.doctorTitle! + " " + appointHistory.doctorNameObj!, + isInOutPatient: appointHistory!.isInOutPatient!, + name: appointHistory!.doctorTitle! + " " + appointHistory!.doctorNameObj!, // billNo: _appointmentResult.invoiceNo, - profileUrl: appointHistory.doctorImageURL, - subName: appointHistory.projectName, - isLiveCareAppointment: appointHistory.isLiveCareAppointment, - date: DateUtil.convertStringToDate(appointHistory.appointmentDate!), - rating: appointHistory.actualDoctorRate! + 0.0, - appointmentTime: appointHistory.startTime!.substring(0, 5), + profileUrl: appointHistory!.doctorImageURL, + subName: appointHistory!.projectName, + isLiveCareAppointment: appointHistory!.isLiveCareAppointment, + date: DateUtil.convertStringToDate(appointHistory!.appointmentDate!), + rating: appointHistory!.actualDoctorRate! + 0.0, + appointmentTime: appointHistory!.startTime!.substring(0, 5), ), ), SizedBox(height: 12), @@ -332,7 +333,7 @@ class _SendFeedbackPageState extends State { images = []; }); selectedStatusIndex = 5; - setMessageType(MessageType.NON); + setMessageType(MessageType.NON, appointHistory); GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: TranslationBase.of(context).yourFeedback); } else { @@ -511,7 +512,7 @@ class _SendFeedbackPageState extends State { } else { isShowListAppointHistory = false; } - setMessageType(messageType); + setMessageType(messageType, appointHistory); }, ), ); diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index 10bd5397..e713989f 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -261,7 +261,7 @@ class ServicesView extends StatelessWidget { MaterialPageRoute( builder: (BuildContext context) => MyWebView( title: "HMG News", - selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + selectedUrl:"https://twitter.com/hmg" //"https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", ), ), ); diff --git a/lib/uitl/app_toast.dart b/lib/uitl/app_toast.dart index db186ddd..d35be3f4 100644 --- a/lib/uitl/app_toast.dart +++ b/lib/uitl/app_toast.dart @@ -23,7 +23,7 @@ class AppToast { static void showSuccessToast({ required String message, Toast toastLength = Toast.LENGTH_LONG, - int? timeInSeconds, + int timeInSeconds =2, double fontSize = 16, ToastGravity toastGravity = ToastGravity.TOP, Color textColor = Colors.white, @@ -31,7 +31,7 @@ class AppToast { int? elevation, int imageSize = 32, }) { - Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds!, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize); + Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize); } static void showErrorToast({ diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 94381ad2..b937f3eb 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -128,8 +128,8 @@ class LocationUtils { heading: 0.0, speed: 0.0, speedAccuracy: 1, - altitudeAccuracy: 0, - headingAccuracy: 0, + // altitudeAccuracy: 0, + // headingAccuracy: 0, // Added by Aamir ), ); diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 7b2b136e..d2da2564 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -529,7 +529,7 @@ class _FloatingSearchButton extends State with TickerProvi Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => MyWebView( title: "HMG News", - selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + selectedUrl:"https://twitter.com/hmg" // "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", ))); } break;