From 44d59ed01aa040f903e8842b363c27b9f74f6939 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 5 Sep 2021 11:23:21 +0300 Subject: [PATCH 1/5] updates & fixes --- lib/core/model/labs/lab_result.dart | 10 +- lib/pages/livecare/livecare_home.dart | 7 +- lib/pages/livecare/widgets/clinic_card.dart | 2 +- lib/pages/livecare/widgets/clinic_list.dart | 269 +++++++----------- lib/pages/login/confirm-login.dart | 5 - lib/pages/login/login.dart | 5 - .../medical/LabResult/LabResultWidget.dart | 1 - lib/widgets/in_app_browser/InAppBrowser.dart | 20 +- 8 files changed, 125 insertions(+), 194 deletions(-) diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 739adf01..4949a3de 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -9,12 +9,12 @@ class LabResultList { class LabResult { String description; - Null femaleInterpretativeData; + dynamic femaleInterpretativeData; int gender; bool isCertificateAllowed; int lineItemNo; - Null maleInterpretativeData; - Null notes; + dynamic maleInterpretativeData; + dynamic notes; int orderLineItemNo; int orderNo; String packageID; @@ -27,11 +27,11 @@ class LabResult { String sampleCollectedOn; String sampleReceivedOn; String setupID; - Null superVerifiedOn; + dynamic superVerifiedOn; String testCode; String uOM; String verifiedOn; - Null verifiedOnDateTime; + dynamic verifiedOnDateTime; LabResult( {this.description, diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index d74dd6c8..2cadd239 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -1,3 +1,6 @@ +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingRequest.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart'; @@ -28,6 +31,8 @@ class _LiveCareHomeState extends State ErRequestHistoryList pendingERRequestHistoryList; + AuthenticatedUserObject authenticatedUserObject = locator(); + @override void initState() { _tabController = new TabController(length: 2, vsync: this); @@ -40,7 +45,7 @@ class _LiveCareHomeState extends State imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/ar/0.png')); WidgetsBinding.instance.addPostFrameCallback((_) { - if (!isDataLoaded) getLiveCareHistory(); + if (!isDataLoaded && authenticatedUserObject.isLogin) getLiveCareHistory(); }); super.initState(); diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 0d9f056c..7276b961 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -39,7 +39,7 @@ class _State extends State { children: [ Card( margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), - color: widget.isSelected ? Colors.blue : widget.isOnline == 1 ? Colors.white : Colors.grey, + color: widget.isSelected ? Colors.blue : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 0b4150aa..3bf83ac0 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -39,6 +39,9 @@ class _clinic_listState extends State { int currentSelectedIndex = 0; LiveCareClinicsListResponse liveCareClinicsListResponse; + List liveCareOnlineClinicsListResponse; + List liveCareOfflineClinicsListResponse; + LiveCareScheduleClinicsListResponse liveCareScheduleClinicsListResponse; bool isDataLoaded = false; @@ -62,8 +65,11 @@ class _clinic_listState extends State { @override void initState() { liveCareClinicsListResponse = new LiveCareClinicsListResponse(); - liveCareScheduleClinicsListResponse = - new LiveCareScheduleClinicsListResponse(); + + liveCareOnlineClinicsListResponse = new List(); + liveCareOfflineClinicsListResponse = new List(); + + liveCareScheduleClinicsListResponse = new LiveCareScheduleClinicsListResponse(); WidgetsBinding.instance.addPostFrameCallback((_) { if (!isLiveCareTypeSelected) { @@ -77,18 +83,14 @@ class _clinic_listState extends State { @override Widget build(BuildContext context) { - return SingleChildScrollView( - child: currentSelectedLiveCareType == "immediate" - ? getLiveCareImmediateClinicList() - : getLiveCareScheduleClinicList()); + return SingleChildScrollView(child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList()); } void startLiveCare() { bool isError = false; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - ERAppointmentFeesResponse erAppointmentFeesResponse = - new ERAppointmentFeesResponse(); + ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse(); service.getERAppointmentFees(selectedClinicID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['HasAppointment'] == true) { @@ -98,9 +100,7 @@ class _clinic_listState extends State { erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); isError = false; } - if (!isError) - getERAppointmentTime( - erAppointmentFeesResponse.getERAppointmentFeesList); + if (!isError) getERAppointmentTime(erAppointmentFeesResponse.getERAppointmentFeesList); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); @@ -158,8 +158,7 @@ class _clinic_listState extends State { service.getERAppointmentTime(selectedClinicID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res); - showLiveCarePaymentDialog( - getERAppointmentFeesList, res['WatingtimeInteger']); + showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); @@ -167,22 +166,16 @@ class _clinic_listState extends State { }); } - showLiveCarePaymentDialog( - GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) { + showLiveCarePaymentDialog(GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) { showGeneralDialog( barrierColor: Colors.black.withOpacity(0.5), transitionBuilder: (context, a1, a2, widget) { - final curvedValue = - Curves.easeInOutBack.transform(a1.value) - 1.0; + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; return Transform( - transform: - Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), child: Opacity( opacity: a1.value, - child: LiveCarePaymentDialog( - getERAppointmentFeesList: getERAppointmentFeesList, - waitingTime: waitingTime, - clinicName: selectedClinicName), + child: LiveCarePaymentDialog(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName), ), ); }, @@ -193,8 +186,7 @@ class _clinic_listState extends State { pageBuilder: (context, animation1, animation2) {}) .then((value) { if (value) { - if (getERAppointmentFeesList.total == "0" || - getERAppointmentFeesList.total == "0.0") { + if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") { showLiveCareInfoDialog(getERAppointmentFeesList); } else { navigateToPaymentMethod(getERAppointmentFeesList, context); @@ -203,11 +195,9 @@ class _clinic_listState extends State { }); } - showLiveCareInfoDialog( - GetERAppointmentFeesList getERAppointmentFeesList) async { + showLiveCareInfoDialog(GetERAppointmentFeesList getERAppointmentFeesList) async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); setState(() { authUser = data; }); @@ -216,11 +206,9 @@ class _clinic_listState extends State { showGeneralDialog( barrierColor: Colors.black.withOpacity(0.5), transitionBuilder: (context, a1, a2, widget) { - final curvedValue = - Curves.easeInOutBack.transform(a1.value) - 1.0; + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; return Transform( - transform: - Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), child: Opacity( opacity: a1.value, child: LiveCareInfoDialog(), @@ -234,11 +222,8 @@ class _clinic_listState extends State { pageBuilder: (context, animation1, animation2) {}) .then((value) { if (value) { - if (getERAppointmentFeesList.total == "0" || - getERAppointmentFeesList.total == "0.0") { - addNewCallForPatientER(authUser.patientID.toString() + - "" + - DateTime.now().millisecondsSinceEpoch.toString()); + if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") { + addNewCallForPatientER(authUser.patientID.toString() + "" + DateTime.now().millisecondsSinceEpoch.toString()); } else { navigateToPaymentMethod(getERAppointmentFeesList, context); } @@ -246,16 +231,14 @@ class _clinic_listState extends State { }); } - Future navigateToPaymentMethod( - GetERAppointmentFeesList getERAppointmentFeesList, context) async { + Future navigateToPaymentMethod(GetERAppointmentFeesList getERAppointmentFeesList, context) async { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.clinicID = selectedClinicID; appo.appointmentNo = DateTime.now().millisecondsSinceEpoch; if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); setState(() { authUser = data; }); @@ -264,32 +247,16 @@ class _clinic_listState extends State { Navigator.push(context, FadePage(page: PaymentMethod())).then((value) { print(value); if (value != null) { - openPayment(value, authUser, - double.parse(getERAppointmentFeesList.total), appo); + openPayment(value, authUser, double.parse(getERAppointmentFeesList.total), appo); } }); } - openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, - double amount, AppoitmentAllHistoryResultList appo) { - browser = new MyInAppBrowser( - onExitCallback: onBrowserExit, - appo: appo, - onLoadStartCallback: onBrowserLoadStart); - - browser.openPaymentBrowser( - amount, - "LiveCare Payment", - Utils.getAppointmentTransID(12, appo.clinicID, appo.appointmentNo), - "12", - authenticatedUser.emailAddress, - paymentMethod, - authenticatedUser.patientType, - authenticatedUser.firstName, - authenticatedUser.patientID, - authenticatedUser, - browser, - false); + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) { + browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); + + browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(12, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod, + authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false); } onBrowserLoadStart(String url) { @@ -321,19 +288,13 @@ class _clinic_listState extends State { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service - .checkPaymentStatus( - Utils.getAppointmentTransID( - appo.projectID, appo.clinicID, appo.appointmentNo), - context) - .then((res) { + service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { GifLoaderDialogUtils.hideDialog(context); print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; if (paymentInfo == 'Success') { - addNewCallForPatientER(Utils.getAppointmentTransID( - appo.projectID, appo.clinicID, appo.appointmentNo)); + addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); } else { AppToast.showErrorToast(message: res['Response_Message']); } @@ -347,12 +308,9 @@ class _clinic_listState extends State { addNewCallForPatientER(String clientRequestID) { LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - service - .addNewCallForPatientER(selectedClinicID, clientRequestID, context) - .then((res) { + service.addNewCallForPatientER(selectedClinicID, clientRequestID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - AppToast.showSuccessToast( - message: "New Call has been added successfully"); + AppToast.showSuccessToast(message: "New Call has been added successfully"); widget.getLiveCareHistory(); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -374,13 +332,19 @@ class _clinic_listState extends State { print(res['PatientER_GetClinicsList'].length); if (res['MessageStatus'] == 1) { setState(() { - liveCareClinicsListResponse = - LiveCareClinicsListResponse.fromJson(res); - print(liveCareClinicsListResponse.patientERGetClinicsList.length); - selectedClinicID = - liveCareClinicsListResponse.patientERGetClinicsList[0].serviceID; - selectedClinicName = liveCareClinicsListResponse - .patientERGetClinicsList[0].serviceName; + liveCareOnlineClinicsListResponse.clear(); + liveCareClinicsListResponse = LiveCareClinicsListResponse.fromJson(res); + + liveCareClinicsListResponse.patientERGetClinicsList.forEach((clinic) { + if (clinic.isOnline == 1) { + liveCareOnlineClinicsListResponse.add(clinic); + } else { + liveCareOfflineClinicsListResponse.add(clinic); + } + }); + + selectedClinicID = liveCareClinicsListResponse.patientERGetClinicsList[0].serviceID; + selectedClinicName = liveCareClinicsListResponse.patientERGetClinicsList[0].serviceName; isDataLoaded = true; }); } else { @@ -403,14 +367,10 @@ class _clinic_listState extends State { print(res['ClinicsHaveScheduleList'].length); if (res['MessageStatus'] == 1) { setState(() { - liveCareScheduleClinicsListResponse = - LiveCareScheduleClinicsListResponse.fromJson(res); - print(liveCareScheduleClinicsListResponse - .clinicsHaveScheduleList.length); - selectedClinicID = liveCareScheduleClinicsListResponse - .clinicsHaveScheduleList[0].serviceID; - selectedClinicName = liveCareScheduleClinicsListResponse - .clinicsHaveScheduleList[0].clinicDesc; + liveCareScheduleClinicsListResponse = LiveCareScheduleClinicsListResponse.fromJson(res); + print(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length); + selectedClinicID = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].serviceID; + selectedClinicName = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].clinicDesc; isDataLoaded = true; }); } else { @@ -483,25 +443,15 @@ class _clinic_listState extends State { shrinkWrap: true, physics: ScrollPhysics(), padding: EdgeInsets.all(0.0), - itemCount: liveCareScheduleClinicsListResponse - .clinicsHaveScheduleList.length, + itemCount: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length, itemBuilder: (context, index) { return InkWell( onTap: () { - updateSelectedScheduleIndex( - liveCareScheduleClinicsListResponse - .clinicsHaveScheduleList[index]); + updateSelectedScheduleIndex(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index]); }, child: ScheduleClinicCard( - isSelected: selectedClinicID == - liveCareScheduleClinicsListResponse - .clinicsHaveScheduleList[index] - .serviceID - ? true - : false, - clinicsHaveScheduleList: - liveCareScheduleClinicsListResponse - .clinicsHaveScheduleList[index], + isSelected: selectedClinicID == liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index].serviceID ? true : false, + clinicsHaveScheduleList: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index], languageID: languageID, ), ); @@ -555,39 +505,51 @@ class _clinic_listState extends State { children: [ Container( margin: EdgeInsets.all(15.0), - child: Text("Online Clinics: ", - style: TextStyle( - fontSize: 20.0, fontWeight: FontWeight.bold)), + child: Text("Online Clinics: ", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + // itemCount: liveCareClinicsListResponse.patientERGetClinicsList.length, + itemCount: liveCareOnlineClinicsListResponse.length, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + updateSelectedIndex(liveCareOnlineClinicsListResponse[index]); + }, + child: ClinicCard( + isSelected: selectedClinicID == liveCareOnlineClinicsListResponse[index].serviceID ? true : false, + patientERGetClinicsList: liveCareOnlineClinicsListResponse[index], + languageID: languageID, + ), + ); + }, + ), + Container( + margin: EdgeInsets.all(15.0), + child: Text("Offline Clinics: ", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), ), ListView.builder( scrollDirection: Axis.vertical, shrinkWrap: true, physics: ScrollPhysics(), padding: EdgeInsets.all(0.0), - itemCount: liveCareClinicsListResponse - .patientERGetClinicsList.length, + // itemCount: liveCareClinicsListResponse.patientERGetClinicsList.length, + itemCount: liveCareOfflineClinicsListResponse.length, itemBuilder: (context, index) { return InkWell( onTap: () { - if (liveCareClinicsListResponse - .patientERGetClinicsList[index].isOnline == - 1) { - updateSelectedIndex(liveCareClinicsListResponse - .patientERGetClinicsList[index]); - } else { - AppToast.showErrorToast( - message: "Clinic is offline"); - } + // if (liveCareClinicsListResponse.patientERGetClinicsList[index].isOnline == 1) { + // updateSelectedIndex(liveCareOnlineClinicsListResponse[index]); + // } else { + // AppToast.showErrorToast(message: "Clinic is offline"); + // } }, child: ClinicCard( - isSelected: selectedClinicID == - liveCareClinicsListResponse - .patientERGetClinicsList[index] - .serviceID - ? true - : false, - patientERGetClinicsList: liveCareClinicsListResponse - .patientERGetClinicsList[index], + isSelected: selectedClinicID == liveCareOfflineClinicsListResponse[index].serviceID ? true : false, + patientERGetClinicsList: liveCareOfflineClinicsListResponse[index], languageID: languageID, ), ); @@ -633,11 +595,8 @@ class _clinic_listState extends State { List doctorsList = []; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - List _patientDoctorAppointmentListHospital = - List(); - service - .getLiveCareScheduledDoctorList(context, selectedClinicID) - .then((res) { + List _patientDoctorAppointmentListHospital = List(); + service.getLiveCareScheduledDoctorList(context, selectedClinicID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { @@ -647,34 +606,23 @@ class _clinic_listState extends State { }); doctorsList.forEach((element) { - List doctorByHospital = - _patientDoctorAppointmentListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + List doctorByHospital = _patientDoctorAppointmentListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .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.projectName, - distanceInKMs: - element.projectDistanceInKiloMeters.toString(), - patientDoctorAppointment: element)); + _patientDoctorAppointmentListHospital + .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); } }); } else {} }); this.sharedPref.setBool(IS_LIVECARE_APPOINTMENT, true); - navigateToSearchResults( - context, doctorsList, _patientDoctorAppointmentListHospital); + navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital); } else {} }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -683,19 +631,8 @@ class _clinic_listState extends State { }); } - Future navigateToSearchResults( - context, - List docList, - List - patientDoctorAppointmentListHospital) async { - Navigator.push( - context, - FadePage( - page: SearchResults( - doctorsList: docList, - isLiveCareAppointment: true, - patientDoctorAppointmentListHospital: - patientDoctorAppointmentListHospital))); + Future navigateToSearchResults(context, List docList, List patientDoctorAppointmentListHospital) async { + Navigator.push(context, FadePage(page: SearchResults(doctorsList: docList, isLiveCareAppointment: true, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))); } updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) { diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index bcbcf6cb..35e9ee15 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -611,11 +611,6 @@ class _ConfirmLogin extends State { .setUser(authenticatedUserObject.user); getToDoCount(); - pharmacyModuleViewModel.generatePharmacyToken().then((value) async { - if (pharmacyModuleViewModel.error.isNotEmpty) - await pharmacyModuleViewModel.createUser(); - }); - appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 448238fd..70627f8d 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -278,11 +278,6 @@ class _Login extends State { // result['CRSVerificationStatus']; projectViewModel.user = authenticatedUserObject.user; - // await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { - // if (pharmacyModuleViewModel.error.isNotEmpty) - // await pharmacyModuleViewModel.createUser(); - // }); - appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index eabe583e..3f5b009d 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -149,7 +149,6 @@ class LabResultWidget extends StatelessWidget { isCovidResult = true; covidLabResult = order; } - print(covidLabResult.testCode); }); return isCovidResult; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 435e4368..e66b2eae 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -23,23 +23,23 @@ var _InAppBrowserOptions = InAppBrowserClassOptions( class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; - static String SERVICE_URL = - 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String PREAUTH_SERVICE_URL = - 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + static String SERVICE_URL = + 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String PREAUTH_SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - static String PRESCRIPTION_PAYMENT_WITH_ORDERID = - 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; + static String PREAUTH_SERVICE_URL = + 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = - // 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live + // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; + + static String PRESCRIPTION_PAYMENT_WITH_ORDERID = + 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live // Packages static String PACKAGES_REQUEST_PAYMENT_URL = From e679c7df0daca8f00dba7b9e3b0f895db777cf37 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 5 Sep 2021 14:38:57 +0300 Subject: [PATCH 2/5] updates & fixes --- lib/core/service/er/er_service.dart | 17 +- .../service/medical/my_balance_service.dart | 2 +- .../medical/my_balance_view_model.dart | 2 +- lib/pages/Blood/confirm_payment_page.dart | 4 +- lib/pages/BookAppointment/BookSuccess.dart | 2 + .../covid-dirvethru-questions.dart | 1 + .../covid-drivethru-location.dart | 134 +++++--------- .../covid-payment-details.dart | 9 - .../covid-payment-summary.dart | 2 + .../ErService/EdOnline/DdServicesPage.dart | 64 +++---- lib/pages/ErService/NearestEr.dart | 164 +++++++++--------- lib/pages/ToDoList/ToDo.dart | 2 + lib/pages/livecare/widgets/clinic_card.dart | 2 +- lib/pages/livecare/widgets/clinic_list.dart | 2 +- .../medical/balance/confirm_payment_page.dart | 4 +- lib/widgets/in_app_browser/InAppBrowser.dart | 10 +- 16 files changed, 186 insertions(+), 235 deletions(-) diff --git a/lib/core/service/er/er_service.dart b/lib/core/service/er/er_service.dart index bd3b6116..3e899f97 100644 --- a/lib/core/service/er/er_service.dart +++ b/lib/core/service/er/er_service.dart @@ -7,9 +7,6 @@ class ErService extends BaseService { List projectAvgERWaitingTimeModelList = List(); Map body = Map(); - String Latitude = ""; - String Longitude = ""; - String PhoneNumber = ""; Future getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { hasError = false; @@ -23,21 +20,15 @@ class ErService extends BaseService { body['Latitude'] = lat ?? 0; body['Longitude'] = long ?? 0; + dynamic localRes; + await baseAppClient.post(GET_NEAREST_HOSPITAL, onSuccess: (dynamic response, int statusCode) { - projectAvgERWaitingTimeModelList.clear(); - response['List_ProjectAvgERWaitingTime'].forEach((vital) { - projectAvgERWaitingTimeModelList - .add(ProjectAvgERWaitingTime.fromJson(vital)); - }); - projectAvgERWaitingTimeModelList.forEach((element) { - Latitude = '${element.latitude}'; - Longitude = '${element.longitude}'; - PhoneNumber = '${element.phoneNumber}'; - }); + localRes = response; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); + return Future.value(localRes); } } diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart index e2744250..6fb91a37 100644 --- a/lib/core/service/medical/my_balance_service.dart +++ b/lib/core/service/medical/my_balance_service.dart @@ -17,7 +17,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class MyBalanceService extends BaseService { List patientAdvanceBalanceAmountList = List(); - double totalAdvanceBalanceAmount; + dynamic totalAdvanceBalanceAmount; List patientInfoList = List(); GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse(); diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index e33bc86c..ce9f35fa 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -38,7 +38,7 @@ class MyBalanceViewModel extends BaseViewModel { //=========================== - double get totalAdvanceBalanceAmount => + dynamic get totalAdvanceBalanceAmount => _myBalanceService.totalAdvanceBalanceAmount; String get updatedRegisterBloodMessage => diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index c384b7b5..f3f7bffb 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -218,7 +218,9 @@ class ConfirmPaymentPage extends StatelessWidget { authenticatedUser.patientID, authenticatedUser, browser, - false); + false, + null, + null); } onBrowserLoadStart(String url) { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 26a5b0fe..fb8b1ac9 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -640,6 +640,8 @@ class _BookSuccessState extends State { authenticatedUser, widget.browser, widget.patientShareResponse.isLiveCareAppointment, + null, + null, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo, widget.patientShareResponse.clinicID, diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index ed048b9f..0f07081f 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -152,6 +152,7 @@ class CovidDirveThruQuestionsState extends State { service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { + covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); Navigator.push( context, FadePage( diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 3846c03b..4040abf5 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'covid-dirvethru-questions.dart'; @@ -34,15 +33,14 @@ class _CovidDrivethruLocationState extends State { String projectID = ""; List imagesInfo = List(); + DriveThroughTestingCenterModel selectedProject; + ProjectViewModel projectViewModel; @override void initState() { imagesInfo.add( - ImagesInfo( - imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'), + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'), ); WidgetsBinding.instance.addPostFrameCallback((_) { if (projectViewModel.isLogin) { @@ -56,9 +54,7 @@ class _CovidDrivethruLocationState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - imagesInfo.add(ImagesInfo( - imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', - imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png')); return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, @@ -72,31 +68,17 @@ class _CovidDrivethruLocationState extends State { mainAxisSize: MainAxisSize.max, children: [ Container( - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Text(TranslationBase.of(context).resultHeader, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 22.0, - color: Colors.black)), + alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, + child: Text(TranslationBase.of(context).resultHeader, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 22.0, color: Colors.black)), ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).covidInfo, - style: TextStyle(fontSize: 16.0, color: Colors.black)), + child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 16.0, color: Colors.black)), ), Container( margin: EdgeInsets.only(top: 20.0), - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Text(TranslationBase.of(context).selectLocation, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18.0, - letterSpacing: 0.8, - color: Colors.grey[700])), + alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, + child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.grey[700])), ), Container( height: 60.0, @@ -112,18 +94,18 @@ class _CovidDrivethruLocationState extends State { width: MediaQuery.of(context).size.width, margin: EdgeInsets.only(top: 15.0), child: DropdownButtonHideUnderline( - child: DropdownButton( + child: DropdownButton( hint: new Text(TranslationBase.of(context).selectAddress), - value: projectDropdownValue, - items: projectsList.map((item) { - return new DropdownMenuItem( - value: item.iD.toString(), + value: selectedProject, + items: projectsList.map((DriveThroughTestingCenterModel item) { + return new DropdownMenuItem( + value: item, child: new Text(item.projectName), ); }).toList(), onChanged: (newValue) { setState(() { - projectDropdownValue = newValue; + selectedProject = newValue; setProjectLocation(newValue); }); }, @@ -132,15 +114,8 @@ class _CovidDrivethruLocationState extends State { isLocationSelected ? Container( margin: EdgeInsets.only(top: 15.0), - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Text(TranslationBase.of(context).selectLocation, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18.0, - letterSpacing: 0.8, - color: Colors.black)), + alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, + child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.black)), ) : Container(), isLocationSelected @@ -149,16 +124,15 @@ class _CovidDrivethruLocationState extends State { decoration: BoxDecoration( border: Border.all(color: Colors.grey[400], width: 1.0), ), - child: Image.network( - "https://maps.googleapis.com/maps/api/staticmap?center=" + - this.projectLat + - "," + - this.projectLong + - "&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" + - this.projectLat + - "," + - this.projectLong + - "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"), + child: Image.network("https://maps.googleapis.com/maps/api/staticmap?center=" + + this.projectLat + + "," + + this.projectLong + + "&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" + + this.projectLat + + "," + + this.projectLong + + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"), ) : SizedBox( height: MediaQuery.of(context).size.height * 0.35, @@ -184,8 +158,7 @@ class _CovidDrivethruLocationState extends State { onPressed: () { getDirections(); }, - child: Text(TranslationBase.of(context).getDirections, - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).getDirections, style: TextStyle(fontSize: 18.0)), ), ), ), @@ -202,8 +175,7 @@ class _CovidDrivethruLocationState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: - MediaQuery.of(context).size.width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), @@ -213,8 +185,7 @@ class _CovidDrivethruLocationState extends State { onPressed: () { back(); }, - child: Text(TranslationBase.of(context).back, - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 18.0)), ), ), ), @@ -227,8 +198,7 @@ class _CovidDrivethruLocationState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: - MediaQuery.of(context).size.width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), @@ -238,8 +208,7 @@ class _CovidDrivethruLocationState extends State { onPressed: () { next(); }, - child: Text(TranslationBase.of(context).next, - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)), ), ), ), @@ -259,22 +228,17 @@ class _CovidDrivethruLocationState extends State { getDirections() { if (isLocationSelected) { - MapsLauncher.launchCoordinates(double.parse(projectLat), - double.parse(projectLong), this.projectName); + MapsLauncher.launchCoordinates(double.parse(projectLat), double.parse(projectLong), this.projectName); } else { - Utils.showErrorToast( - "Please select address from the dropdown menu to get directions"); + Utils.showErrorToast("Please select address from the dropdown menu to get directions"); } } next() { if (isLocationSelected) { - Navigator.push( - context, - FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList,))); + Navigator.push(context, FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList))); } else { - Utils.showErrorToast( - "Please select address from the dropdown menu to continue"); + Utils.showErrorToast("Please select address from the dropdown menu to continue"); } } @@ -282,34 +246,25 @@ class _CovidDrivethruLocationState extends State { Navigator.of(context).popAndPushNamed(HOME); } - setProjectLocation(newValue) { - print(newValue); + setProjectLocation(DriveThroughTestingCenterModel newValue) { setState(() { - this.projectLat = - projectsList[(int.parse(newValue) - 1)].latitude.toString(); - this.projectLong = - projectsList[(int.parse(newValue) - 1)].longitude.toString(); - this.projectName = projectsList[(int.parse(newValue) - 1)].projectName; - this.projectID = - projectsList[(int.parse(newValue) - 1)].projectID.toString(); + this.projectLat = newValue.latitude.toString(); + this.projectLong = newValue.longitude.toString(); + this.projectName = newValue.projectName; + this.projectID = newValue.projectID.toString(); isLocationSelected = true; }); } getPaymentInfo(BuildContext context, String projectID) { CovidDriveThruService service = new CovidDriveThruService(); - CovidPaymentInfoResponse covidPaymentInfoResponse = - new CovidPaymentInfoResponse(); + CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); GifLoaderDialogUtils.showMyDialog(context); - service - .getCovidPaymentInformation( - context, int.parse(projectID), proceduresList[0].procedureID) - .then((res) { + service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { - covidPaymentInfoResponse = - CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); + covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); }); Navigator.push( context, @@ -329,8 +284,7 @@ class _CovidDrivethruLocationState extends State { CovidDriveThruService service = new CovidDriveThruService(); GifLoaderDialogUtils.showMyDialog(context); - CovidTestProceduresResponse covidTestProceduresResponse = - new CovidTestProceduresResponse(); + CovidTestProceduresResponse covidTestProceduresResponse = new CovidTestProceduresResponse(); service.getCovidTestProceduresList(context).then((res) { if (res['MessageStatus'] == 1) { diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index 488dd3bf..67b973fe 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -30,7 +30,6 @@ class _CovidPaymentDetailsState extends State { @override void initState() { - print(widget.proceduresList[0].procedureName); widget.selectedProcedure = widget.proceduresList[0]; super.initState(); } @@ -336,14 +335,6 @@ class _CovidPaymentDetailsState extends State { widget.covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); }); - // Navigator.push( - // context, - // FadePage( - // page: CovidPaymentDetails( - // covidPaymentInfoResponse: covidPaymentInfoResponse, - // projectID: int.parse(projectID), - // proceduresList: proceduresList, - // ))); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index e71285b5..c3c70578 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -191,6 +191,8 @@ class _CovidPaymentSummaryState extends State { authenticatedUser, widget.browser, widget.patientShareResponse.isLiveCareAppointment, + null, + null, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo, widget.patientShareResponse.clinicID, diff --git a/lib/pages/ErService/EdOnline/DdServicesPage.dart b/lib/pages/ErService/EdOnline/DdServicesPage.dart index 7395b901..47f73c42 100644 --- a/lib/pages/ErService/EdOnline/DdServicesPage.dart +++ b/lib/pages/ErService/EdOnline/DdServicesPage.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -44,36 +45,39 @@ class _DdServicesPageState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return Scaffold( - appBar: AppBar( - elevation: 0, - textTheme: TextTheme( - headline6: TextStyle( - color: Theme.of(context).textTheme.headline1.color, - fontWeight: FontWeight.bold), - ), - title: Text( - 'ED Online', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Theme.of(context).textTheme.headline1.color, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), - // bold: true, - // color: Colors.white, - ), - leading: Builder( - builder: (BuildContext context) { - return IconButton( - icon: Icon(Icons.arrow_back), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () { - showConfirmMessage(context); - }, - ); - }, - ), - centerTitle: true, - ), + return AppScaffold( + appBarTitle: 'ED Online', + isShowDecPage: true, + isShowAppBar: true, + // appBarTitle: AppBar( + // elevation: 0, + // textTheme: TextTheme( + // headline6: TextStyle( + // color: Theme.of(context).textTheme.headline1.color, + // fontWeight: FontWeight.bold), + // ), + // title: Text( + // 'ED Online', + // style: TextStyle( + // fontWeight: FontWeight.bold, + // color: Theme.of(context).textTheme.headline1.color, + // fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + // // bold: true, + // // color: Colors.white, + // ), + // leading: Builder( + // builder: (BuildContext context) { + // return IconButton( + // icon: Icon(Icons.arrow_back), + // color: Theme.of(context).textTheme.headline1.color, + // onPressed: () { + // showConfirmMessage(context); + // }, + // ); + // }, + // ), + // centerTitle: true, + // ), body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 0ecb19a7..57a3a8ae 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -1,16 +1,15 @@ -import 'package:diplomaticquarterapp/core/viewModels/er/near_hospital_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; +import 'package:diplomaticquarterapp/core/service/er/er_service.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import '../../uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; import 'widgets/card_position.dart'; -class NearestEr extends StatelessWidget { +class NearestEr extends StatefulWidget { static const String _url = "assets/images/"; int appointmentNo; @@ -18,92 +17,89 @@ class NearestEr extends StatelessWidget { NearestEr({this.appointmentNo, this.projectID}); + @override + _NearestErState createState() => _NearestErState(); +} + +class _NearestErState extends State { + List projectAvgERWaitingTimeModelList = List(); + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((_) => getERList()); + super.initState(); + } + @override Widget build(BuildContext context) { var size = MediaQuery.of(context).size; final double itemHeight = (size.height - kToolbarHeight - 24) / 2; final double itemWidth = size.width / 2; - return BaseView( - onModelReady: appointmentNo != null && projectID != null - ? (model) => model.getProjectAvgERWaitingTimeOrders( - id: appointmentNo, projectID: projectID) - : (model) => model.getProjectAvgERWaitingTimeOrders(), - builder: (_, mode, widget) => AppScaffold( - isShowAppBar: true, - isShowDecPage: false, - appBarTitle: TranslationBase.of(context).NearestEr, - baseViewModel: mode, - body: mode.ProjectAvgERWaitingTimeModeList.length > 0 - ? Container( - child: ListView( - children: [ - Text( - "${TranslationBase.of(context).NearestErDesc}", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 18.0, - letterSpacing: 1.0, - fontWeight: FontWeight.w900, - color: new Color(0xFF60686b))), - Container( - margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), - child: GridView.count( - crossAxisCount: 2, - childAspectRatio: (itemWidth / itemWidth), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - controller: - new ScrollController(keepScrollOffset: false), - shrinkWrap: true, - padding: const EdgeInsets.all(4.0), - children: List.generate(7, (index) { - return Container( - child: CardPosition( - waitingTime: mode - .ProjectAvgERWaitingTimeModeList[index] - .avgTimeInHHMM - .toString(), - text: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: '${mode.ProjectAvgERWaitingTimeModeList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}', - type: mode - .ProjectAvgERWaitingTimeModeList[index].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[index] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[index] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[index] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectName, - cardSize: itemWidth, - ), - ); - }), - ), + return AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).NearestEr, + body: projectAvgERWaitingTimeModelList.length > 0 + ? Container( + child: ListView( + children: [ + Text("${TranslationBase.of(context).NearestErDesc}", + textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, letterSpacing: 1.0, fontWeight: FontWeight.w900, color: new Color(0xFF60686b))), + Container( + margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), + child: GridView.count( + crossAxisCount: 2, + childAspectRatio: (itemWidth / itemWidth), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + controller: new ScrollController(keepScrollOffset: false), + shrinkWrap: true, + padding: const EdgeInsets.all(4.0), + children: List.generate(7, (index) { + return Container( + child: CardPosition( + waitingTime: projectAvgERWaitingTimeModelList[index].avgTimeInHHMM.toString(), + text: projectAvgERWaitingTimeModelList[index].projectName.toString(), + image: 'assets/images/new-design/find_us_icon.png', + subText: '${projectAvgERWaitingTimeModelList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}', + type: projectAvgERWaitingTimeModelList[index].iD.toString(), + telephone: projectAvgERWaitingTimeModelList[index].phoneNumber.toString(), + networkImage: projectAvgERWaitingTimeModelList[index].projectImageURL.toString(), + latitude: projectAvgERWaitingTimeModelList[index].latitude, + longitude: projectAvgERWaitingTimeModelList[index].longitude, + projectname: projectAvgERWaitingTimeModelList[index].projectName, + cardSize: itemWidth, + ), + ); + }), ), - ], - ), - ) - : Center( - child: Texts('No Data'), + ), + ], ), - ), + ) + : Center( + child: Texts('No Data'), + ), ); } + + getERList() async { + GifLoaderDialogUtils.showMyDialog(context); + ErService service = new ErService(); + service.getProjectAvgERWaitingTimeOrders().then((response) { + if (response['MessageStatus'] == 1) { + setState(() { + projectAvgERWaitingTimeModelList.clear(); + response['List_ProjectAvgERWaitingTime'].forEach((vital) { + projectAvgERWaitingTimeModelList.add(ProjectAvgERWaitingTime.fromJson(vital)); + }); + }); + GifLoaderDialogUtils.hideDialog(context); + } else {} + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + }); + } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index febbdf0f..6e9d6bce 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -774,6 +774,8 @@ class _ToDoState extends State { authenticatedUser, widget.browser, appo.isLiveCareAppointment, + null, + null, appo.appointmentDate, appo.appointmentNo, appo.clinicID, diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 7276b961..6a7573d7 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -39,7 +39,7 @@ class _State extends State { children: [ Card( margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), - color: widget.isSelected ? Colors.blue : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey, + color: widget.isSelected ? Color(0xff06b806) : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 3bf83ac0..94bce343 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -256,7 +256,7 @@ class _clinic_listState extends State { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(12, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod, - authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false); + authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID.toString()); } onBrowserLoadStart(String url) { diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index eecb6abd..0d2fac93 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -226,7 +226,9 @@ class ConfirmPaymentPage extends StatelessWidget { advanceModel.fileNumber, authenticatedUser, browser, - false); + false, + null, + null); } onBrowserLoadStart(String url) { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e66b2eae..b4aed910 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -168,6 +168,8 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authenticatedUser, InAppBrowser browser, bool isLiveCareAppo, + var servID, + var LiveServID, [var appoDate, var appoNo, var clinicID, @@ -186,6 +188,8 @@ class MyInAppBrowser extends InAppBrowser { patientID, authenticatedUser, isLiveCareAppo, + servID, + LiveServID, appoDate, appoNo, clinicID, @@ -233,13 +237,13 @@ class MyInAppBrowser extends InAppBrowser { dynamic patientID, AuthenticatedUser authUser, bool isLiveCareAppo, + var servID, + var LiveServID, [var appoDate, var appoNo, var clinicID, var doctorID, - var patientData, - var servID, - var LiveServID]) async { + var patientData]) async { getDeviceToken(); String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; String form = isLiveCareAppo ? getLiveCareForm() : getForm(); From f577905dcbada771dba26fe6ea8bf1e0645e1ed0 Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Sun, 5 Sep 2021 14:47:37 +0300 Subject: [PATCH 3/5] eye measurment new design --- lib/config/config.dart | 4 +- .../model/eye/AppoimentAllHistoryResult.dart | 237 ++++++----- .../all_habib_medical_service_page.dart | 22 +- .../fragments/home_page_fragment2.dart | 7 +- lib/pages/landing/home_page_2.dart | 7 +- lib/pages/landing/landing_page.dart | 3 + lib/pages/landing/widgets/slider_view.dart | 1 + lib/pages/medical/eye/ClassesPage.dart | 240 ++++++----- lib/pages/medical/eye/ContactLensPage.dart | 231 +++++------ lib/pages/medical/eye/EyeHomePage.dart | 390 +++++++++++++++--- .../medical/eye/EyeMeasurementsPage.dart | 148 +++---- .../vital_sign/vital_sign_details_screen.dart | 10 +- .../medical/time_line_new_widget.dart | 1 + 13 files changed, 777 insertions(+), 524 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 45c31e14..7152cbbe 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/core/model/eye/AppoimentAllHistoryResult.dart b/lib/core/model/eye/AppoimentAllHistoryResult.dart index ed123023..71c9573b 100644 --- a/lib/core/model/eye/AppoimentAllHistoryResult.dart +++ b/lib/core/model/eye/AppoimentAllHistoryResult.dart @@ -66,74 +66,76 @@ class AppoimentAllHistoryResultList { String qR; int remaniningHoursTocanPay; bool sMSButtonVisable; + bool isInOutPatient; - AppoimentAllHistoryResultList( - {this.setupID, - this.projectID, - this.appointmentNo, - this.appointmentDate, - this.appointmentDateN, - this.appointmentType, - this.bookDate, - this.patientID, - this.doctorID, - this.endDate, - this.startTime, - this.endTime, - this.status, - this.visitFor, - this.patientStatusType, - this.companyID, - this.bookedBy, - this.bookedOn, - this.confirmedBy, - this.confirmedOn, - this.arrivalChangedBy, - this.arrivedOn, - this.editedBy, - this.editedOn, - this.doctorName, - this.doctorNameN, - this.statusDesc, - this.statusDescN, - this.vitalStatus, - this.vitalSignAppointmentNo, - this.episodeID, - this.actualDoctorRate, - this.clinicName, - this.complainExists, - this.doctorImageURL, - this.doctorNameObj, - this.doctorRate, - this.doctorSpeciality, - this.doctorTitle, - this.gender, - this.genderDescription, - this.iSAllowOnlineCheckedIN, - this.isActiveDoctor, - this.isActiveDoctorProfile, - this.isDoctorAllowVedioCall, - this.isExecludeDoctor, - this.isFollowup, - this.isLiveCareAppointment, - this.isMedicalReportRequested, - this.isOnlineCheckedIN, - this.latitude, - this.listHISGetContactLensPerscription, - this.listHISGetGlassPerscription, - this.longitude, - this.nextAction, - this.noOfPatientsRate, - this.originalClinicID, - this.originalProjectID, - this.projectName, - this.qR, - this.remaniningHoursTocanPay, - this.sMSButtonVisable, - this.clinicID, - this.patientType, - - this.visitType}); + AppoimentAllHistoryResultList({ + this.setupID, + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitFor, + this.patientStatusType, + this.companyID, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.editedBy, + this.editedOn, + this.doctorName, + this.doctorNameN, + this.statusDesc, + this.statusDescN, + this.vitalStatus, + this.vitalSignAppointmentNo, + this.episodeID, + this.actualDoctorRate, + this.clinicName, + this.complainExists, + this.doctorImageURL, + this.doctorNameObj, + this.doctorRate, + this.doctorSpeciality, + this.doctorTitle, + this.gender, + this.genderDescription, + this.iSAllowOnlineCheckedIN, + this.isActiveDoctor, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isFollowup, + this.isLiveCareAppointment, + this.isMedicalReportRequested, + this.isOnlineCheckedIN, + this.latitude, + this.listHISGetContactLensPerscription, + this.listHISGetGlassPerscription, + this.longitude, + this.nextAction, + this.noOfPatientsRate, + this.originalClinicID, + this.originalProjectID, + this.projectName, + this.qR, + this.remaniningHoursTocanPay, + this.sMSButtonVisable, + this.clinicID, + this.patientType, + this.visitType, + this.isInOutPatient, + }); AppoimentAllHistoryResultList.fromJson(Map json) { setupID = json['SetupID']; @@ -176,7 +178,7 @@ class AppoimentAllHistoryResultList { doctorImageURL = json['DoctorImageURL']; doctorNameObj = json['DoctorNameObj']; doctorRate = json['DoctorRate']; - // doctorSpeciality = json['DoctorSpeciality'].cast(); + doctorSpeciality = json['DoctorSpeciality'].cast(); doctorTitle = json['DoctorTitle']; gender = json['Gender']; genderDescription = json['GenderDescription']; @@ -191,18 +193,15 @@ class AppoimentAllHistoryResultList { isOnlineCheckedIN = json['IsOnlineCheckedIN']; latitude = json['Latitude']; if (json['List_HIS_GetContactLensPerscription'] != null) { - listHISGetContactLensPerscription = - new List(); + listHISGetContactLensPerscription = new List(); json['List_HIS_GetContactLensPerscription'].forEach((v) { - listHISGetContactLensPerscription - .add(new ListHISGetContactLensPerscription.fromJson(v)); + listHISGetContactLensPerscription.add(new ListHISGetContactLensPerscription.fromJson(v)); }); } if (json['List_HIS_GetGlassPerscription'] != null) { listHISGetGlassPerscription = new List(); json['List_HIS_GetGlassPerscription'].forEach((v) { - listHISGetGlassPerscription - .add(new ListHISGetGlassPerscription.fromJson(v)); + listHISGetGlassPerscription.add(new ListHISGetGlassPerscription.fromJson(v)); }); } longitude = json['Longitude']; @@ -218,6 +217,7 @@ class AppoimentAllHistoryResultList { patientType = json['patientType']; status = json['status']; visitType = json['visitType']; + isInOutPatient = json['IsInOutPatient']; } Map toJson() { @@ -277,14 +277,10 @@ class AppoimentAllHistoryResultList { data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN; data['Latitude'] = this.latitude; if (this.listHISGetContactLensPerscription != null) { - data['List_HIS_GetContactLensPerscription'] = this - .listHISGetContactLensPerscription - .map((v) => v.toJson()) - .toList(); + data['List_HIS_GetContactLensPerscription'] = this.listHISGetContactLensPerscription.map((v) => v.toJson()).toList(); } if (this.listHISGetGlassPerscription != null) { - data['List_HIS_GetGlassPerscription'] = - this.listHISGetGlassPerscription.map((v) => v.toJson()).toList(); + data['List_HIS_GetGlassPerscription'] = this.listHISGetGlassPerscription.map((v) => v.toJson()).toList(); } data['Longitude'] = this.longitude; data['NextAction'] = this.nextAction; @@ -325,23 +321,23 @@ class ListHISGetContactLensPerscription { ListHISGetContactLensPerscription( {this.setupId, - this.projectId, - this.patientType, - this.patientId, - this.encounterType, - this.encounterNo, - this.oDOS, - this.brand, - this.baseCurve, - this.power, - this.diameter, - this.oZ, - this.cT, - this.blend, - this.remarks, - this.status, - this.isActive, - this.createdOn}); + this.projectId, + this.patientType, + this.patientId, + this.encounterType, + this.encounterNo, + this.oDOS, + this.brand, + this.baseCurve, + this.power, + this.diameter, + this.oZ, + this.cT, + this.blend, + this.remarks, + this.status, + this.isActive, + this.createdOn}); ListHISGetContactLensPerscription.fromJson(Map json) { setupId = json['SetupId']; @@ -415,28 +411,28 @@ class ListHISGetGlassPerscription { ListHISGetGlassPerscription( {this.projectID, - this.setupID, - this.patientId, - this.encounterType, - this.encounterNo, - this.visionType, - this.rightEyeSpherical, - this.rightEyeCylinder, - this.rightEyeAxis, - this.rightEyePrism, - this.rightEyeVA, - this.rightEyeRemarks, - this.leftEyeSpherical, - this.leftEyeCylinder, - this.leftEyeAxis, - this.leftEyePrism, - this.leftEyeVA, - this.leftEyeRemarks, - this.pD, - this.bVD, - this.status, - this.isActive, - this.createdOn}); + this.setupID, + this.patientId, + this.encounterType, + this.encounterNo, + this.visionType, + this.rightEyeSpherical, + this.rightEyeCylinder, + this.rightEyeAxis, + this.rightEyePrism, + this.rightEyeVA, + this.rightEyeRemarks, + this.leftEyeSpherical, + this.leftEyeCylinder, + this.leftEyeAxis, + this.leftEyePrism, + this.leftEyeVA, + this.leftEyeRemarks, + this.pD, + this.bVD, + this.status, + this.isActive, + this.createdOn}); ListHISGetGlassPerscription.fromJson(Map json) { projectID = json['ProjectID']; @@ -492,6 +488,3 @@ class ListHISGetGlassPerscription { return data; } } - - - diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 3e3af59c..c7b91f89 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_mod import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/hmg_services.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart'; @@ -56,11 +57,11 @@ class _AllHabibMedicalServiceState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); - PharmacyModuleViewModel pharmacyModuleViewModel = - locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); LocationUtils locationUtils; var weather = '--'; WeatherService _weatherService = WeatherService(); + List hmgServices = []; @override void initState() { @@ -71,9 +72,23 @@ class _AllHabibMedicalServiceState extends State { super.initState(); } + initialiseHmgServices(bool isLogin) { + hmgServices.clear(); + hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/visa.png", isLogin)); + hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); + hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); + hmgServices.add(new HmgServices(5, "RRT", TranslationBase.of(context).emergency, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(new HmgServices(6, TranslationBase.of(context).refferal, TranslationBase.of(context).services2, "assets/images/new/E_Referral.svg", isLogin)); + hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin)); + hmgServices.add(new HmgServices(8, TranslationBase.of(context).reachUs, TranslationBase.of(context).findUs, "assets/images/new/reach_us.svg", isLogin)); + } + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + initialiseHmgServices(false); return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).alhabiServices, @@ -282,8 +297,7 @@ class _AllHabibMedicalServiceState extends State { Navigator.pop(context); LandingPage.shared.switchToDoFromHMGServices(); }, - imageLocation: - 'assets/images/new-design/upcoming_icon_bottom_bar.png', + imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png', title: TranslationBase.of(context).todoList, ), if (projectViewModel.havePrivilege(42)) diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index dae43863..374a69e5 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -26,9 +26,9 @@ import 'dart:math' as math; class HomePageFragment2 extends StatefulWidget { DashboardViewModel model; - Function onPharmacyClick, onLoginClick; + Function onPharmacyClick, onLoginClick,onMedicalFileClick; - HomePageFragment2(this.model, {this.onLoginClick, this.onPharmacyClick}); + HomePageFragment2(this.model, {this.onLoginClick, this.onPharmacyClick,this.onMedicalFileClick}); @override _HomePageFragment2State createState() => _HomePageFragment2State(); @@ -129,7 +129,8 @@ class _HomePageFragment2State extends State { ), FlatButton( onPressed: () { - navigateTo(context, MedicalProfilePageNew()); + widget.onMedicalFileClick(); + // navigateTo(context, MedicalProfilePageNew()); }, child: Text( TranslationBase.of(context).viewMedicalFile, diff --git a/lib/pages/landing/home_page_2.dart b/lib/pages/landing/home_page_2.dart index 5e786011..4e063d20 100644 --- a/lib/pages/landing/home_page_2.dart +++ b/lib/pages/landing/home_page_2.dart @@ -25,9 +25,9 @@ import 'landing_page_pharmcy.dart'; class HomePage2 extends StatefulWidget { final Function goToMyProfile; - Function onLoginClick; + Function onLoginClick, onMedicalFileClick; - HomePage2({Key key, this.goToMyProfile, this.onLoginClick}); + HomePage2({Key key, this.goToMyProfile, this.onLoginClick, this.onMedicalFileClick}); @override _HomePageState2 createState() => _HomePageState2(); @@ -58,6 +58,9 @@ class _HomePageState2 extends State { onPharmacyClick: () { getPharmacyToken(model); }, + onMedicalFileClick: () { + widget.onMedicalFileClick(); + }, ) ], ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index e8fa0b65..d3d37204 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -607,6 +607,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { onLoginClick: () { login(); }, + onMedicalFileClick: (){ + changeCurrentTab(1); + }, ), MedicalProfilePageNew(), Search(), diff --git a/lib/pages/landing/widgets/slider_view.dart b/lib/pages/landing/widgets/slider_view.dart index bc52cf02..bb7afae6 100644 --- a/lib/pages/landing/widgets/slider_view.dart +++ b/lib/pages/landing/widgets/slider_view.dart @@ -106,6 +106,7 @@ class SliderView extends StatelessWidget { color: Colors.white, fontSize: 13, letterSpacing: -0.39, + height: 1, ), ), ), diff --git a/lib/pages/medical/eye/ClassesPage.dart b/lib/pages/medical/eye/ClassesPage.dart index 21a07d23..273a8088 100644 --- a/lib/pages/medical/eye/ClassesPage.dart +++ b/lib/pages/medical/eye/ClassesPage.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; @@ -16,119 +17,101 @@ class ClassesPage extends StatelessWidget { final String projectName; final int projectID; - const ClassesPage( - {Key key, - this.glassPerscription, - this.appointmentNo, - this.projectName, - this.projectID}) - : super(key: key); + const ClassesPage({Key key, this.glassPerscription, this.appointmentNo, this.projectName, this.projectID}) : super(key: key); @override Widget build(BuildContext context) { - return BaseView( - builder: (_, model, w) => AppScaffold( - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), - child: Column( - children: [ - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).rightEye, - fontSize: 23, - bold: true, + return SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 20, left: 20, right: 20, bottom: 20), + child: Column( + children: [ + Card( + shape: cardRadius(12), + elevation: 1, + child: Container( + + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + TranslationBase.of(context).rightEye, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, ), ), - getRow(TranslationBase.of(context).sphere, - '${glassPerscription.rightEyeSpherical}', '-'), - getRow(TranslationBase.of(context).cylinder, - '${glassPerscription.rightEyeCylinder}', '-'), - getRow(TranslationBase.of(context).axis, - '${glassPerscription.rightEyeAxis}', '-'), - getRow(TranslationBase.of(context).prism, - '${glassPerscription.rightEyePrism}', '-'), - getRow(TranslationBase.of(context).va, - '${glassPerscription.rightEyeVA}', '-'), - ], - ), - ), - SizedBox( - height: 17, + ), + getRow(TranslationBase.of(context).sphere, '${glassPerscription.rightEyeSpherical}', '-'), + getRow(TranslationBase.of(context).cylinder, '${glassPerscription.rightEyeCylinder}', '-'), + getRow(TranslationBase.of(context).axis, '${glassPerscription.rightEyeAxis}', '-'), + getRow(TranslationBase.of(context).prism, '${glassPerscription.rightEyePrism}', '-'), + getRow(TranslationBase.of(context).va, '${glassPerscription.rightEyeVA}', '-',isLast:true), + ], ), - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).leftEye, - fontSize: 23, - bold: true, - ), + ), + ), + SizedBox( + height: 12, + ), + Card( + shape: cardRadius(12), + elevation: 1, + child: Container( child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + TranslationBase.of(context).leftEye, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, ), - getRow(TranslationBase.of(context).sphere, - '${glassPerscription.leftEyeSpherical}', '-'), - getRow(TranslationBase.of(context).cylinder, - '${glassPerscription.leftEyeCylinder}', '-'), - getRow(TranslationBase.of(context).axis, - '${glassPerscription.leftEyeAxis}', '-'), - getRow(TranslationBase.of(context).prism, - '${glassPerscription.leftEyePrism}', '-'), - getRow(TranslationBase.of(context).va, - '${glassPerscription.leftEyeVA}', '-'), - ], - ), - ), - SizedBox( - height: 17, - ), - Container( - width: double.infinity, - child: SecondaryButton( - label: TranslationBase.of(context).sendEmail, - onTap: () { - showConfirmMessage(context, () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.sendGlassesPrescriptionEmail( - appointmentNo: appointmentNo, - projectName: projectName, - projectID: projectID); - GifLoaderDialogUtils.hideDialog(context); - }, model.user.emailAddress); - }, - textColor: Colors.white, - color: Colors.red[700], - icon: Icon( - Icons.email, - color: Colors.white, ), ), - ) - ], + getRow(TranslationBase.of(context).sphere, '${glassPerscription.leftEyeSpherical}', '-'), + getRow(TranslationBase.of(context).cylinder, '${glassPerscription.leftEyeCylinder}', '-'), + getRow(TranslationBase.of(context).axis, '${glassPerscription.leftEyeAxis}', '-'), + getRow(TranslationBase.of(context).prism, '${glassPerscription.leftEyePrism}', '-'), + getRow(TranslationBase.of(context).va, '${glassPerscription.leftEyeVA}', '-',isLast:true), + ], + ), + ), ), - ), + SizedBox( + height: 17, + ), + // Container( + // width: double.infinity, + // child: SecondaryButton( + // label: TranslationBase.of(context).sendEmail, + // onTap: () { + // showConfirmMessage(context, () async { + // GifLoaderDialogUtils.showMyDialog(context); + // await model.sendGlassesPrescriptionEmail(appointmentNo: appointmentNo, projectName: projectName, projectID: projectID); + // GifLoaderDialogUtils.hideDialog(context); + // }, model.user.emailAddress); + // }, + // textColor: Colors.white, + // color: Colors.red[700], + // icon: Icon( + // Icons.email, + // color: Colors.white, + // ), + // ), + // ) + ], ), ), ); } - void showConfirmMessage( - BuildContext context, GestureTapCallback onTap, String email) { + void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { showDialog( context: context, child: ConfirmSendEmailDialog( @@ -140,31 +123,40 @@ class ClassesPage extends StatelessWidget { ); } - Widget getRow(String title, String val1, String val2) => Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded(flex: 4, child: Texts(title)), - Expanded( - flex: 2, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Texts(val1 == 'null' ? '-' : val1), - Texts(val2 != 'null' ? '-' : val2), - ], - ), - ) - ], - ), - Divider() - ], + Widget getRow(String title, String val1, String val2,{bool isLast=false}) => Padding( + padding: const EdgeInsets.only(left: 8,right: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(flex: 4, child: Text(title,style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4),)), + Expanded( + flex: 2, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Text( + val1 == 'null' ? '-' : val1, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), + ), + Text( + val2 != 'null' ? '-' : val2, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), + ), + ], + ), + ) + ], + ), ), - ); + isLast?Container(height: 4,): Divider() + ], + ), + ); } diff --git a/lib/pages/medical/eye/ContactLensPage.dart b/lib/pages/medical/eye/ContactLensPage.dart index b70b9c09..ae00dbfd 100644 --- a/lib/pages/medical/eye/ContactLensPage.dart +++ b/lib/pages/medical/eye/ContactLensPage.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; @@ -18,120 +19,107 @@ class ContactLensPage extends StatelessWidget { final String projectName; final int projectID; - const ContactLensPage( - {Key key, - this.listHISGetContactLensPerscription, - this.appointmentNo, - this.projectName, - this.projectID}) - : super(key: key); + const ContactLensPage({Key key, this.listHISGetContactLensPerscription, this.appointmentNo, this.projectName, this.projectID}) : super(key: key); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - builder: (_,model,w)=> - AppScaffold( + builder: (_, model, w) => AppScaffold( body: SingleChildScrollView( child: Container( - margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), + margin: EdgeInsets.only(top: 20, left: 20, right: 20, bottom: 20), child: Column( children: [ - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).rightEye, - fontSize: 23, - bold: true, + Card( + shape: cardRadius(12), + elevation: 1, + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + TranslationBase.of(context).rightEye, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), ), - ), - getRow(TranslationBase.of(context).brand, - '${listHISGetContactLensPerscription.brand}'), - getRow('B.C', - '${listHISGetContactLensPerscription.baseCurve}'), - getRow(TranslationBase.of(context).power, - '${listHISGetContactLensPerscription.power}'), - getRow(TranslationBase.of(context).diameter, - '${listHISGetContactLensPerscription.diameter}'), - getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), - getRow('CT', '${listHISGetContactLensPerscription.cT}'), - getRow( - 'Blend', '${listHISGetContactLensPerscription.blend}'), - getRow(TranslationBase.of(context).reminder, - '${listHISGetContactLensPerscription.remarks}'), - ], + getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), + getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), + getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), + getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), + getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), + getRow('CT', '${listHISGetContactLensPerscription.cT}'), + getRow('Blend', '${listHISGetContactLensPerscription.blend}'), + getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}', isLast: true), + ], + ), ), ), SizedBox( - height: 17, + height: 12, ), - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).leftEye, - fontSize: 23, - bold: true, + Card( + shape: cardRadius(12), + elevation: 1, + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + TranslationBase.of(context).leftEye, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + ), ), - ), - getRow(TranslationBase.of(context).brand, - '${listHISGetContactLensPerscription.brand}'), - getRow('B.C', - '${listHISGetContactLensPerscription.baseCurve}'), - getRow(TranslationBase.of(context).power, - '${listHISGetContactLensPerscription.power}'), - getRow(TranslationBase.of(context).diameter, - '${listHISGetContactLensPerscription.diameter}'), - getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), - getRow('CT', '${listHISGetContactLensPerscription.cT}'), - getRow( - 'Blend', '${listHISGetContactLensPerscription.blend}'), - getRow(TranslationBase.of(context).reminder, - '${listHISGetContactLensPerscription.remarks}'), - ], + getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), + getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), + getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), + getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), + getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), + getRow('CT', '${listHISGetContactLensPerscription.cT}'), + getRow('Blend', '${listHISGetContactLensPerscription.blend}'), + getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}', isLast: true), + ], + ), ), ), SizedBox( height: 17, ), - if (projectViewModel.havePrivilege(15)) - Container( - width: double.infinity, - child: SecondaryButton( - label: TranslationBase.of(context).sendEmail, - textColor: Colors.white, - color: Colors.red[700], - onTap: (){ - showConfirmMessage(context, () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.sendContactLensPrescriptionEmail( - appointmentNo: appointmentNo, - projectName: projectName, - projectID: projectID); - GifLoaderDialogUtils.hideDialog(context); - }, model.user.emailAddress); - }, - icon: Icon( - Icons.email, - color: Colors.white, - ), - ), - ) + // if (projectViewModel.havePrivilege(15)) + // Container( + // width: double.infinity, + // child: SecondaryButton( + // label: TranslationBase.of(context).sendEmail, + // textColor: Colors.white, + // color: Colors.red[700], + // onTap: (){ + // showConfirmMessage(context, () async { + // GifLoaderDialogUtils.showMyDialog(context); + // await model.sendContactLensPrescriptionEmail( + // appointmentNo: appointmentNo, + // projectName: projectName, + // projectID: projectID); + // GifLoaderDialogUtils.hideDialog(context); + // }, model.user.emailAddress); + // }, + // icon: Icon( + // Icons.email, + // color: Colors.white, + // ), + // ), + // ) ], ), ), @@ -140,35 +128,48 @@ class ContactLensPage extends StatelessWidget { ); } - Widget getRow(String title, String val1) => Padding( - padding: const EdgeInsets.all(8.0), + Widget getRow(String title, String val1, {bool isLast = false}) => Padding( + padding: const EdgeInsets.only(left: 8, right: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded(flex: 4, child: Texts(title)), - Expanded( - flex: 2, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(val1 == 'null' ? '-' : val1), - ], - ), - ) - ], + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + flex: 4, + child: Text( + title, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), + )), + Expanded( + flex: 2, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + val1 == 'null' ? '-' : val1, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), + ), + ], + ), + ) + ], + ), ), - Divider() + isLast + ? Container( + height: 4, + ) + : Divider() ], ), ); - - void showConfirmMessage( - BuildContext context, GestureTapCallback onTap, String email) { + void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { showDialog( context: context, child: ConfirmSendEmailDialog( diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 3af2279e..de5c7cba 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -3,12 +3,25 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; +import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; +import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:rating_bar/rating_bar.dart'; import 'ClassesPage.dart'; import 'ContactLensPage.dart'; @@ -16,21 +29,26 @@ import 'ContactLensPage.dart'; class EyeHomePage extends StatefulWidget { final AppoimentAllHistoryResultList appointmentAllHistoryResultList; - const EyeHomePage({Key key, this.appointmentAllHistoryResultList}) - : super(key: key); + const EyeHomePage({Key key, this.appointmentAllHistoryResultList}) : super(key: key); @override _EyeHomePageState createState() => _EyeHomePageState(); } -class _EyeHomePageState extends State - with SingleTickerProviderStateMixin { +class _EyeHomePageState extends State with SingleTickerProviderStateMixin { TabController _tabController; + List doctorDetailsList = List(); @override void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(() { + + setState(() { + + }); + }); } @override @@ -41,76 +59,97 @@ class _EyeHomePageState extends State @override Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - isShowDecPage: false, - appBarTitle: TranslationBase.of(context).measurements, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(60.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj, + showNewAppBarTitle: true, + showNewAppBar: true, + backgroundColor: CustomColors.appBackgroudGreyColor, + body: Column( + children: [ + DoctorHeader( + headerModel: HeaderModel( + widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj, + widget.appointmentAllHistoryResultList.doctorImageURL, + widget.appointmentAllHistoryResultList.doctorSpeciality, + "", + widget.appointmentAllHistoryResultList.projectName, + DateUtil.convertStringToDate(widget.appointmentAllHistoryResultList.appointmentDate), + widget.appointmentAllHistoryResultList.startTime.substring(0, 5), + null, + widget.appointmentAllHistoryResultList.doctorRate, + widget.appointmentAllHistoryResultList.actualDoctorRate, + widget.appointmentAllHistoryResultList.noOfPatientsRate, + "", + //model.user.emailAddress, ), - Center( - child: Container( - height: 55.0, - margin: EdgeInsets.only(left: 20,right: 20,top: 15), - color: Colors.white, - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.40, - child: Center( - child: Texts(TranslationBase.of(context).classes), + isNeedToShowButton: _tabController.index==0?true:projectViewModel.havePrivilege(15), + showConfirmMessageDialog: true, + onRatingAndReviewTap: getDoctorRatingsDetails, + onTap: () { + showConfirmMessage(context, () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendGlassesPrescriptionEmail( + appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo, + projectName: widget.appointmentAllHistoryResultList.projectName, + projectID: widget.appointmentAllHistoryResultList.projectID); + GifLoaderDialogUtils.hideDialog(context); + }, model.user.emailAddress); + }, + ), + Container( + height: 45.0, + width: double.infinity, + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorWeight: 2.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + // width: double.infinity, + child: Center( + child: Text( + TranslationBase.of(context).classes, + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.36, ), ), - Container( - width: MediaQuery.of(context).size.width * 0.40, - child: Center( - child: Texts(TranslationBase.of(context).contactLens), + ), + ), + Container( + // width: double.infinity, + child: Center( + child: Text( + TranslationBase.of(context).contactLens, + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.36, ), ), - ], + ), ), - ), + ], ), ), - ], - ), - ), - body: Column( - children: [ + ), Expanded( child: TabBarView( - physics: BouncingScrollPhysics(), + physics: NeverScrollableScrollPhysics(), controller: _tabController, children: [ ClassesPage( - glassPerscription: widget.appointmentAllHistoryResultList - .listHISGetGlassPerscription[0], + glassPerscription: widget.appointmentAllHistoryResultList.listHISGetGlassPerscription[0], appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo, projectName: widget.appointmentAllHistoryResultList.projectName, projectID: widget.appointmentAllHistoryResultList.projectID, @@ -129,4 +168,233 @@ class _EyeHomePageState extends State ), ); } + + void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: email, + onTapSendEmail: () { + onTap(); + }, + ), + ); + } + + void getDoctorRatingsDetails() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList.doctorID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + doctorDetailsList.clear(); + res['DoctorRatingDetailsList'].forEach((v) { + doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); + }); + showRatingDialog(doctorDetailsList); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + void showRatingDialog(List doctorDetailsList) { + 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: Dialog( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + // height: 400.0, + width: MediaQuery.of(context).size.width * 0.8, + color: Colors.white, + child: Column( + children: [ + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width, + color: Theme.of(context).primaryColor, + margin: EdgeInsets.only(bottom: 5.0), + padding: EdgeInsets.all(10.0), + child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Text(this.widget.appointmentAllHistoryResultList.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: this.widget.appointmentAllHistoryResultList.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(this.widget.appointmentAllHistoryResultList.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews, + style: TextStyle(fontSize: 14.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[0].patientNumber), + height: 6.0, + child: Container( + color: Colors.green[700], + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[1].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffB7B723), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[2].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEBA727), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[3].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEB7227), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[4].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffE20C0C), + ), + ), + ), + ], + ), + ), + Container(margin: EdgeInsets.only(top: 40.0), child: Divider()), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Align( + alignment: FractionalOffset.bottomCenter, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 40.0, + child: RaisedButton( + elevation: 0.0, + color: Colors.white, + textColor: Colors.red, + hoverColor: Colors.transparent, + focusColor: Colors.transparent, + highlightColor: Colors.transparent, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); + } + + double getRatingWidth(int patientNumber) { + var width = (patientNumber / this.widget.appointmentAllHistoryResultList.noOfPatientsRate) * 100; + return width; + } } diff --git a/lib/pages/medical/eye/EyeMeasurementsPage.dart b/lib/pages/medical/eye/EyeMeasurementsPage.dart index 8dbe0f16..0aa7b69c 100644 --- a/lib/pages/medical/eye/EyeMeasurementsPage.dart +++ b/lib/pages/medical/eye/EyeMeasurementsPage.dart @@ -1,9 +1,13 @@ +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; @@ -24,97 +28,69 @@ class EyeMeasurementsPage extends StatelessWidget { builder: (_, model, w) => AppScaffold( isShowAppBar: true, baseViewModel: model, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGreyColor, appBarTitle: TranslationBase.of(context).eyeMeasurements, body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.all(8), - child: Column( - children: [ - ...List.generate( - model.appointmentFilter.length, - (index) => AppExpandableNotifier( + child: Column( + children: [ + ListView.separated( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.only(top: 12), + separatorBuilder: (context, index) { + return Container( + height: 1, + margin: EdgeInsets.only(left: 21, right: 21), + color: Color(0xffD9D9D9), + ); + }, + itemBuilder: (context, index) { + List _appointmentAllHistoryResultList = model.appointmentFilter[index].appointmentAllHistoryResultList; + return AppExpandableNotifier( title: model.appointmentFilter[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model.appointmentFilter[index] - .appointmentAllHistoryResultList - .map((appointment) { - return InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: EyeHomePage( - appointmentAllHistoryResultList: appointment, - ), - ), - ); - }, - child: Container( - margin: EdgeInsets.all(8), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - color: Colors.white, - border: Border.all(color: Colors.grey), - ), - child: Row( - children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: appointment.doctorNameObj, - url: appointment.doctorImageURL, - ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - appointment.doctorNameObj, - bold: true, - ), - Texts( - appointment.clinicName, - variant: 'caption3', - ), - Texts( - DateUtil.getMonthDayYearDateFormatted( - appointment.bookDate), - variant: 'caption3', - ), - StarRating( - totalAverage: appointment - .actualDoctorRate - .toDouble(), - forceStars: true), - ], - ), + bodyWidget: ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), + itemBuilder: (context, _index) { + AppoimentAllHistoryResultList _appointmentResult = _appointmentAllHistoryResultList[_index]; + + return DoctorCard( + onTap: () => Navigator.push( + context, + FadePage( + page: EyeHomePage( + appointmentAllHistoryResultList: _appointmentResult, ), ), - Icon( - projectViewModel.isArabic - ? Icons.arrow_forward_ios - : Icons.arrow_back_ios, - color: Colors.grey, - size: 18, - ) - ], - ), - ), - ); - }).toList(), - ), - ), - ), - ], - ), + ), + isInOutPatient: _appointmentResult.isInOutPatient, + name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj, + // billNo: "appointmentResult.do", + profileUrl: _appointmentResult.doctorImageURL, + subName: _appointmentResult.clinicName, + isLiveCareAppointment: _appointmentResult.isLiveCareAppointment, + date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate), + isSortByClinic: false, + rating: _appointmentResult.actualDoctorRate + 0.0, + // appointmentTime: _appointmentResult.startTime.substring(0, 5), + // remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED) + // ? _appointmentResult.remaniningHoursTocanPay + // : null + + //projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate) : DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate), + ); + }, + separatorBuilder: (context, index) => SizedBox(height: 14), + itemCount: _appointmentAllHistoryResultList.length), + ); + }, + itemCount: model.appointmentFilter.length, + ), + + ], ), ), ), diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index 18519d1b..9a9dbd10 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -87,15 +87,15 @@ class VitalSignDetailsScreen extends StatelessWidget { height: MediaQuery.of(context).size.width / 2.8, child: Row( children: [ - showMass(context, "Underweight", "<18.5", double.parse(mode.bodyMax) <= 18.5 ? Colors.red : Colors.black, 8), + showMass(context, "Underweight", "< 18.5", double.parse(mode.bodyMax) <= 18.5 ? Colors.red : Colors.black, 8), mWidth(12), - showMass(context, "Normal", "18.5-24.9", (double.parse(mode.bodyMax) >= 18.5 || double.parse(mode.bodyMax) >= 24.6) ? Colors.red : Colors.black, 6), + showMass(context, "Normal", "18.5 - 24.9", (double.parse(mode.bodyMax) > 18.5 && double.parse(mode.bodyMax) < 25) ? Colors.red : Colors.black, 6), mWidth(12), - showMass(context, "Overweight", "25-29.9", (double.parse(mode.bodyMax) >= 25 || double.parse(mode.bodyMax) >= 29.9) ? Colors.red : Colors.black, 4), + showMass(context, "Overweight", "25 - 29.9", (double.parse(mode.bodyMax) >= 25 && double.parse(mode.bodyMax) < 30) ? Colors.red : Colors.black, 4), mWidth(12), - showMass(context, "Obese", "30-34.9", (double.parse(mode.bodyMax) >= 30 || double.parse(mode.bodyMax) >= 34.9) ? Colors.red : Colors.black, 2), + showMass(context, "Obese", "30 - 34.9", (double.parse(mode.bodyMax) >= 30 && double.parse(mode.bodyMax) < 35) ? Colors.red : Colors.black, 2), mWidth(12), - showMass(context, "Extreme Obese", ">35", (double.parse(mode.bodyMax) >= 35) ? Colors.red : Colors.black, 0), + showMass(context, "Extreme Obese", "> 35", (double.parse(mode.bodyMax) >= 35) ? Colors.red : Colors.black, 0), ], ), ), diff --git a/lib/widgets/data_display/medical/time_line_new_widget.dart b/lib/widgets/data_display/medical/time_line_new_widget.dart index 09ab030c..1679a8ef 100644 --- a/lib/widgets/data_display/medical/time_line_new_widget.dart +++ b/lib/widgets/data_display/medical/time_line_new_widget.dart @@ -256,6 +256,7 @@ class _TimeLineViewState extends State { color: Colors.white, fontSize: 12, letterSpacing: -0.33, + height: 1, ), ), ), From 4469ae1209a407d0665011292618a8e7ca54f021 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 5 Sep 2021 17:12:58 +0300 Subject: [PATCH 4/5] updates & fixes --- lib/config/localized_values.dart | 40 +- lib/main.dart | 2 - .../ComprehensiveMedicalCheckup/cmc_page.dart | 5 +- .../HomeHealthCare/home_health_care_page.dart | 6 +- .../all_habib_medical_service_page.dart | 119 ++---- .../AlHabibMedicalService/h2o/h2o_page.dart | 33 +- lib/pages/Blood/blood_donation.dart | 101 ++---- .../ChildVaccines/child_vaccines_page.dart | 27 +- .../rapid-response-team/rrt-main-screen.dart | 100 ++--- .../insurance/insurance_card_screen.dart | 4 +- lib/pages/landing/home_page.dart | 200 +++++----- lib/pages/landing/landing_page.dart | 2 +- .../ask_doctor/ask_doctor_home_page.dart | 57 ++- .../medical/balance/advance_payment_page.dart | 1 + .../medical/eye/EyeMeasurementsPage.dart | 7 + .../medical/my_invoices/my_invoice_page.dart | 12 +- .../medical/my_trackers/my_trackers.dart | 16 +- .../medical/reports/monthly_reports.dart | 20 + .../smart_watch_instructions.dart | 15 +- lib/pages/vaccine/my_vaccines_screen.dart | 343 ++++++++---------- lib/uitl/translations_delegate_base.dart | 18 + lib/uitl/utils.dart | 102 ++---- .../bottom_navigation/bottom_nav_bar.dart | 2 - .../bottom_navigation_item.dart | 1 - 24 files changed, 587 insertions(+), 646 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c92367a6..e16b0249 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1300,9 +1300,9 @@ const Map localizedValues = { }, "RRTDDetails": { "en": - "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home", + "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a complete medical team at home", "ar": - "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home" + "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a complete medical team at home" }, "rrtService": {"en": "RRT Service", "ar": "خدمة RRT"}, @@ -2224,4 +2224,40 @@ const Map localizedValues = { "en": "Total Appointment Time:", "ar": "وقت المواعيد الكلي:" }, + "info-eye": { + "en": "This service allows you to view all the eye measurements, lenses, and eyeglasses that have been made in the Habib Medical Group.", + "ar": " خدمة قياسات النظر: هذه الخدمة تمكنك من الاطلاع على جميع قياسات النظر والعدسات والنظارات التي تمت في مجموعة الحبيب الطبية." + }, + "info-vaccines": { + "en": "This service allows you to view all the vaccinations that were taken in Al Habib Medical Group.", + "ar": "خدمة تطعيماتي: هذه الخدمة تمكنك من الاطلاع على جميع التطعيمات التي تمت في مجموعة الحبيب الطبية." + }, + "info-trackers": { + "en": "This service allows you to record the readings of the measurement of sugar, pressure, and weight and then refer to them as a reference in addition to view the statistics charts.", + "ar": "متابعة قراءاتي: هذه الخدمة تمكنك من تسجيل قراءات قياس السكر والضغط والوزن بشكل دوري ومن ثم الاطلاع عليها كمرجع وكذلك الاطلاع على الرسوم البيانية لمتابعة تطور الحالة." + }, + "info-health-data": { + "en": "This service is designed to allows you to synchronize the health data from your smart watches into your health record system in Habib Medical Group so that the doctors you are visiting can analyze your health & activity level.", + "ar": "تم تصميم هذه الخدمة للسماح لك بمزامنة البيانات الصحية من ساعاتك الذكية الى نظام السجلات الصحية الخاص بك في مجموعة حبيب الطبية حتى يتمكن الأطباء الذين تزورهم من تحليل مستوى صحتك ونشاطك." + }, + "info-ask-doc": { + "en": "This service allows you to ask the doctor you have visited during the last 14 days. When you receive a response from the doctor, you will be notified via the system to view the doctor's reply.", + "ar": "اسال طبيبك: هذه الخدمة تمكنك من توجيه استفسارات الى الطبيب الذي قمت بزيارته خلال اخر 14 يوم وكذلك عند تلقى الرد من الطبيب سوف يتم ابلاغك عن طريق النظام للاطلاع على رد الطبيب." + }, + "info-auto-wifi": { + "en": "This service allows you to connect to the Internet directly without the need for entering a user name or password.", + "ar": "الاتصال بالانترنت: هذه الخدمة تمكنك من الاتصال بالانترنت مباشرة دون الحاجة الى اسم مستخدم او كلمة مرور." + }, + "auto-wifi": { + "en": "Connect To Internet", + "ar": "الإتصال بالإنترنت" + }, + "child-vaccine-info": { + "en": "This service to remind you of the deadlines of the necessary vaccinations for your child’s against diseases targeted by immunization according to the MOH vaccinations schedule by sending a reminding message and notifications of the vaccination date to the registered mobile phone.", + "ar": "هذه الخدمة تم تصميمها لتذكيرك بالمواعيد النهائية للتحصينات اللازمة لطفلك ضد الأمراض المستهدفة بالتحصين وفقًا لجدول تطعيمات وزارة الصحة عن طريق إرسال رسالة تذكير وإشعارات عن مواعيد التطعيم على الجوال المسجل." + }, + "h2o-info": { + "en": "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.", + "ar": "تم تصميم هذه الخدمة لمساعدتك في تحديد وتتبع كميات المياه التي يتوجب شربها بشكل يومي. كما توفر هذه الخدمة تذكيرات الجدول الزمني وتقدم تحليلًا إحصائيًا لمقدار ما استهلكته خلال اليوم أو الأسبوع أو الشهر." + }, }; diff --git a/lib/main.dart b/lib/main.dart index bf090720..2f1e465f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,8 +8,6 @@ import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:firebase_analytics/firebase_analytics.dart'; -import 'package:firebase_analytics/observer.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart index f1d3e72f..d7ebad6c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -43,9 +43,8 @@ class _CMCPageState extends State with SingleTickerProviderStateMixin { description: TranslationBase.of(context).infoCMC, imagesInfo: [ ImagesInfo( - imageAr: 'assets/images/Wifi-AR.png', - imageEn: 'assets/images/wifi-EN.png', - isAsset: true) + imageAr: 'https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png', + imageEn: 'https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png') ], appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, body: Scaffold( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart index b39c918f..001ecbb1 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart @@ -2,7 +2,6 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -46,9 +45,8 @@ class _HomeHealthCarePageState extends State appBarTitle: TranslationBase.of(context).homeHealthCare, imagesInfo: [ ImagesInfo( - imageAr: 'assets/images/Wifi-AR.png', - imageEn: 'assets/images/wifi-EN.png', - isAsset: true) + imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png', + imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png') ], body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index d6a60e3d..3d4294ec 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; @@ -22,6 +23,7 @@ import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; @@ -56,8 +58,7 @@ class _AllHabibMedicalServiceState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); - PharmacyModuleViewModel pharmacyModuleViewModel = - locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); LocationUtils locationUtils; var weather = '--'; WeatherService _weatherService = WeatherService(); @@ -65,12 +66,8 @@ class _AllHabibMedicalServiceState extends State { @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance.addPostFrameCallback((_) => { - Geolocator.getLastKnownPosition() - .then((value) => setLocation(value)) - }); + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance.addPostFrameCallback((_) => {Geolocator.getLastKnownPosition().then((value) => setLocation(value))}); }); super.initState(); } @@ -109,14 +106,12 @@ class _AllHabibMedicalServiceState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context) - .healthWeatherIndicators, + TranslationBase.of(context).healthWeatherIndicators, color: Colors.white, fontWeight: FontWeight.w600, ), Texts( - TranslationBase.of(context) - .healthTipsBasedOnCurrentWeather, + TranslationBase.of(context).healthTipsBasedOnCurrentWeather, color: Colors.white, fontSize: 14, ), @@ -144,11 +139,7 @@ class _AllHabibMedicalServiceState extends State { width: 60, height: 60, ), - Directionality( - textDirection: TextDirection.ltr, - child: AppText(weather, - fontSize: 22, - color: Colors.white)) + Directionality(textDirection: TextDirection.ltr, child: AppText(weather, fontSize: 22, color: Colors.white)) ], ), Texts( @@ -173,8 +164,7 @@ class _AllHabibMedicalServiceState extends State { ), ); }, - imageLocation: - 'assets/images/new-design/my_file_bottom_bar.png', + imageLocation: 'assets/images/new-design/my_file_bottom_bar.png', title: TranslationBase.of(context).myMedicalFile, ), ServicesContainer( @@ -196,8 +186,7 @@ class _AllHabibMedicalServiceState extends State { ), ), ), - imageLocation: - 'assets/images/new-design/booking_icon_active.png', + imageLocation: 'assets/images/new-design/booking_icon_active.png', title: TranslationBase.of(context).bookAppo, ), ServicesContainer( @@ -207,8 +196,7 @@ class _AllHabibMedicalServiceState extends State { page: PaymentService(), ), ), - imageLocation: - 'assets/images/al-habib_online_payment_service_icon.png', + imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), ServicesContainer( @@ -218,17 +206,15 @@ class _AllHabibMedicalServiceState extends State { page: AnicllaryOrders(), ), ), - imageLocation: - 'assets/images/comprehensive_medical_checkup_logo.png', + imageLocation: 'assets/images/comprehensive_medical_checkup_logo.png', title: TranslationBase.of(context).anicllaryOrders, ), ServicesContainer( onTap: () => Navigator.push( context, - FadePage(), + FadePage(page: CovidDrivethruLocation()), ), - imageLocation: - 'assets/images/al-habib_online_payment_service_icon.png', + imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).covid19_driveThrueTest, ), ServicesContainer( @@ -247,12 +233,6 @@ class _AllHabibMedicalServiceState extends State { ), ServicesContainer( onTap: () => getPharmacyToken(), - // Navigator.push( - // context, - // FadePage( - // page: ParkingPage(), - // ), - // ), imageLocation: 'assets/images/pharmacy_logo.png', title: TranslationBase.of(context).pharmacy), ServicesContainer( @@ -262,8 +242,7 @@ class _AllHabibMedicalServiceState extends State { page: InsuranceUpdate(), ), ), - imageLocation: - 'assets/images/medical/insurance_card_icon.png', + imageLocation: 'assets/images/medical/insurance_card_icon.png', title: TranslationBase.of(context).updateInsurance, ), ServicesContainer( @@ -281,8 +260,7 @@ class _AllHabibMedicalServiceState extends State { page: MyFamily(), ), ), - imageLocation: - 'assets/images/new-design/family_menu_icon_red.png', + imageLocation: 'assets/images/new-design/family_menu_icon_red.png', title: TranslationBase.of(context).myFamily, ), if (projectViewModel.havePrivilege(35)) @@ -291,8 +269,7 @@ class _AllHabibMedicalServiceState extends State { context, FadePage(page: ChildVaccinesPage()), ), - imageLocation: - 'assets/images/new-design/children_vaccines_icon.png', + imageLocation: 'assets/images/new-design/children_vaccines_icon.png', title: TranslationBase.of(context).childVaccine, ), ServicesContainer( @@ -300,18 +277,17 @@ class _AllHabibMedicalServiceState extends State { Navigator.pop(context); LandingPage.shared.switchToDoFromHMGServices(); }, - imageLocation: - 'assets/images/new-design/upcoming_icon_bottom_bar.png', + imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png', title: TranslationBase.of(context).todoList, ), - if (projectViewModel.havePrivilege(42)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(page: SymptomInfo()), - ), - imageLocation: 'assets/images/new-design/body_icon.png', - title: TranslationBase.of(context).symptomCheckerTitle), + // if (projectViewModel.havePrivilege(42)) + // ServicesContainer( + // onTap: () => Navigator.push( + // context, + // FadePage(page: SymptomInfo()), + // ), + // imageLocation: 'assets/images/new-design/body_icon.png', + // title: TranslationBase.of(context).symptomCheckerTitle), if (projectViewModel.havePrivilege(36)) ServicesContainer( onTap: () => Navigator.push( @@ -328,8 +304,7 @@ class _AllHabibMedicalServiceState extends State { page: (HealthCalculators()), ), ), - imageLocation: - 'assets/images/new-design/health_calculator_icon.png', + imageLocation: 'assets/images/new-design/health_calculator_icon.png', title: TranslationBase.of(context).calculators, ), ServicesContainer( @@ -339,20 +314,12 @@ class _AllHabibMedicalServiceState extends State { page: HealthConverter(), ), ), - imageLocation: - 'assets/images/new-design/health_convertor_icon.png', + imageLocation: 'assets/images/new-design/health_convertor_icon.png', title: TranslationBase.of(context).converters, ), if (projectViewModel.havePrivilege(38)) ServicesContainer( - onTap: () => - Navigator.push(context, FadePage(page: H2OPage())), - // Navigator.push( - // context, - // FadePage( - // page: H2OPageIndexPage(), - // ), - // ), + onTap: () => Navigator.push(context, FadePage(page: H2OPage())), imageLocation: 'assets/images/new-design/water_icon.png', title: TranslationBase.of(context).h2o, ), @@ -360,10 +327,11 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(), + FadePage( + page: SmartWatchInstructions() + ), ), - imageLocation: - 'assets/images/new-design/smartwatch_icon.png', + imageLocation: 'assets/images/new-design/smartwatch_icon.png', title: TranslationBase.of(context).smartWatches, ), ServicesContainer( @@ -373,15 +341,12 @@ class _AllHabibMedicalServiceState extends State { page: ParkingPage(), ), ), - imageLocation: - 'assets/images/new-design/parking_system_icon.png', + imageLocation: 'assets/images/new-design/parking_system_icon.png', title: TranslationBase.of(context).parking, ), ServicesContainer( - onTap: () => launch( - "https://hmgwebservices.com/vt_mobile/html/index.html"), - imageLocation: - 'assets/images/new-design/virtual_tour_icon.png', + onTap: () => launch("https://hmgwebservices.com/vt_mobile/html/index.html"), + imageLocation: 'assets/images/new-design/virtual_tour_icon.png', title: TranslationBase.of(context).vTour, ), ServicesContainer( @@ -389,12 +354,10 @@ 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/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", ))); }, - imageLocation: - 'assets/images/new-design/twitter_dashboard_icon.png', + imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', title: TranslationBase.of(context).latestNews, ), ServicesContainer( @@ -436,8 +399,7 @@ class _AllHabibMedicalServiceState extends State { getAuthUser() async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); setState(() { authUser = data; }); @@ -451,8 +413,7 @@ class _AllHabibMedicalServiceState extends State { }); } else { setState(() { - weather = - data != null ? data['Temperature'].toString() + '\u2103' : '--'; + weather = data != null ? data['Temperature'].toString() + '\u2103' : '--'; }); } } diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index b847190f..7c4e8b8b 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -1,12 +1,12 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_page.dart'; -import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; @@ -49,22 +49,29 @@ class _H2OPageState extends State with SingleTickerProviderStateMixin { builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).waterTracker, + description: TranslationBase.of(context).h2oInfo, + imagesInfo: [ + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/ar/0.png') + ], showHomeAppBarIcon: false, baseViewModel: model, isHelp: true, appBarIcons: [ - IconButton( - icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), - color: Colors.white, - onPressed: () { - Navigator.push( - context, - FadePage( - page: H2oSetting(userDetailModel: model.userDetail, viewModel: model), - ), - ); - }, - ), + model.isLogin + ? IconButton( + icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), + color: Colors.white, + onPressed: () { + Navigator.push( + context, + FadePage( + page: H2oSetting(userDetailModel: model.userDetail, viewModel: model), + ), + ); + }, + ) + : Container(), ], body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index ce6ab8ee..f362c2bc 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -56,28 +56,28 @@ class _BloodDonationPageState extends State { AuthenticatedUser authenticatedUser; GetAllSharedRecordsByStatusList selectedPatientFamily; AdvanceModel advanceModel = AdvanceModel(); - List_BloodGroupDetailsModel bloodDetails = - List_BloodGroupDetailsModel(bloodGroup: "A-"); + List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-"); AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser; var checkedValue = false; List imagesInfo = List(); + + ProjectViewModel projectProvider; + @override void initState() { + imagesInfo.add( + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'), + ); + WidgetsBinding.instance.addPostFrameCallback((_) { + if (projectProvider.isLogin) getAuthUser(); + }); super.initState(); - getAuthUser(); } @override Widget build(BuildContext context) { - imagesInfo.add( - ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'), - ); - ProjectViewModel projectProvider = Provider.of(context); + projectProvider = Provider.of(context); return BaseView( onModelReady: (model) => model.getCities(), //model.getHospitals(), @@ -102,22 +102,16 @@ class _BloodDonationPageState extends State { height: 12, ), InkWell( - onTap: () => - confirmSelectHospitalDialog(model.CitiesModelList), + onTap: () => confirmSelectHospitalDialog(model.CitiesModelList), //model.hospitals child: Container( padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getHospitalName(projectProvider, context)), - Icon(Icons.arrow_drop_down) - ], + children: [Texts(getHospitalName(projectProvider, context)), Icon(Icons.arrow_drop_down)], ), ), ), @@ -132,9 +126,7 @@ class _BloodDonationPageState extends State { padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -156,9 +148,7 @@ class _BloodDonationPageState extends State { padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -175,16 +165,14 @@ class _BloodDonationPageState extends State { Row( children: [ Container( - child: Text( - TranslationBase.of(context).viewTermsConditions), + child: Text(TranslationBase.of(context).viewTermsConditions), ), SizedBox( width: MediaQuery.of(context).size.height * 0.10, ), InkWell( onTap: () { - Navigator.of(context) - .push(FadePage(page: UserAgreementPage())); + Navigator.of(context).push(FadePage(page: UserAgreementPage())); }, child: Container( child: Texts( @@ -220,12 +208,8 @@ class _BloodDonationPageState extends State { width: 10, ), Text( - TranslationBase.of(context) - .iAgreeToTheTermsAndConditions, - style: Theme.of(context).textTheme.subtitle1.copyWith( - color: checkedValue - ? Color(0xFFc5272d) - : Colors.black), + TranslationBase.of(context).iAgreeToTheTermsAndConditions, + style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue ? Color(0xFFc5272d) : Colors.black), ), ], ), @@ -247,23 +231,15 @@ class _BloodDonationPageState extends State { builder: (_) => AssetGiffyDialog( title: Text( "", - style: TextStyle( - fontSize: 22.0, - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600), ), - image: Image.asset( - 'assets/images/BloodChrt_EN.png'), - buttonCancelText: Text( - TranslationBase.of(context).cancel), + image: Image.asset('assets/images/BloodChrt_EN.png'), + buttonCancelText: Text(TranslationBase.of(context).cancel), buttonCancelColor: Colors.grey, onlyCancelButton: true, )); }, - child: Container( - width: 250, - height: 200, - child: Image.asset( - 'assets/images/BloodChrt_EN.png')), + child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png')), ), ), ), @@ -293,19 +269,15 @@ class _BloodDonationPageState extends State { label: TranslationBase.of(context).save, onTap: () async { if (_selectedHospital == null) { - AppToast.showErrorToast( - message: TranslationBase.of(context).selectCity); + AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); return; } - bloodDetails.city = projectProvider.isArabic - ? _selectedHospital.descriptionN - : _selectedHospital.description; + bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; bloodDetails.cityCode = _selectedHospital.iD.toString(); bloodDetails.gender = gender == Gender.Male ? 1 : 2; await model.updateBloodGroup(bloodDetails); if (model.state == ViewState.Idle) { - AppToast.showSuccessToast( - message: model.updatedRegisterBloodMessage); + AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); } else { AppToast.showErrorToast(message: model.error); } @@ -325,8 +297,7 @@ class _BloodDonationPageState extends State { setState(() { if (value == BeneficiaryType.MyAccount) { _fileTextController.text = model.user.patientID.toString(); - advanceModel.depositorName = - model.user.firstName + " " + model.user.lastName; + advanceModel.depositorName = model.user.firstName + " " + model.user.lastName; } else _fileTextController.text = ""; @@ -453,8 +424,7 @@ class _BloodDonationPageState extends State { ); } - void confirmSelectFamilyDialog( - List getAllSharedRecordsByStatusList) { + void confirmSelectFamilyDialog(List getAllSharedRecordsByStatusList) { showDialog( context: context, child: SelectPatientFamilyDialog( @@ -463,8 +433,7 @@ class _BloodDonationPageState extends State { onValueSelected: (value) { setState(() { selectedPatientFamily = value; - _fileTextController.text = - selectedPatientFamily.patientID.toString(); + _fileTextController.text = selectedPatientFamily.patientID.toString(); advanceModel.depositorName = value.patientName; }); }, @@ -538,12 +507,9 @@ class _BloodDonationPageState extends State { return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary; } - String getHospitalName( - ProjectViewModel projectProvider, BuildContext context) { + String getHospitalName(ProjectViewModel projectProvider, BuildContext context) { if (_selectedHospital != null) - return projectProvider.isArabic - ? _selectedHospital.descriptionN - : _selectedHospital.description; + return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; else return TranslationBase.of(context).selectCity; // return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital; @@ -558,8 +524,7 @@ class _BloodDonationPageState extends State { getAuthUser() async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); setState(() { authUser = data; }); diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index 38c6b5af..f70fe64d 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -1,6 +1,5 @@ -import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -18,8 +17,7 @@ class ChildVaccinesPage extends StatefulWidget { _ChildVaccinesPageState createState() => _ChildVaccinesPageState(); } -class _ChildVaccinesPageState extends State - with SingleTickerProviderStateMixin { +class _ChildVaccinesPageState extends State with SingleTickerProviderStateMixin { TextEditingController titleController = TextEditingController(); var checkedValue = false; String addEmail = ""; @@ -30,9 +28,17 @@ class _ChildVaccinesPageState extends State onModelReady: (model) => model.getUserInformationRequestOrders(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - baseViewModel: model, + isShowDecPage: true, + description: TranslationBase.of(context).childVaccineInfo, + imagesInfo: [ + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/en/0.png', + imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/ar/0.png'), + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/en/1.png', + imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/ar/1.png') + ], appBarTitle: TranslationBase.of(context).vaccination, - //TranslationBase.of(context).advancePayment, body: SingleChildScrollView( physics: ScrollPhysics(), child: Column( @@ -80,16 +86,14 @@ class _ChildVaccinesPageState extends State margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( fillColor: Colors.red, - hintText: model.user.emailAddress, + hintText: model.user != null ? model.user.emailAddress : "", controller: titleController, fontSize: 20, hintColor: Colors.black, fontWeight: FontWeight.w600, onChanged: (text) { addEmail = text; - model.user.emailAddress == addEmail - ? checkedValue = false - : checkedValue = true; + model.user.emailAddress == addEmail ? checkedValue = false : checkedValue = true; }, validator: (value) { if (value == null) { @@ -119,8 +123,7 @@ class _ChildVaccinesPageState extends State // onTap: () { model.user.emailAddress = addEmail.toString(); - AppToast.showSuccessToast( - message: TranslationBase.of(context).updateEmailMsg); + AppToast.showSuccessToast(message: TranslationBase.of(context).updateEmailMsg); // bloodDetails.city=_selectedHospital.toString(); // bloodDetails. diff --git a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart index 905d0810..9ee7bd1c 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart @@ -1,4 +1,4 @@ - +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-logs-page.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-request-page.dart'; @@ -8,13 +8,12 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class RRTMainScreen extends StatefulWidget{ +class RRTMainScreen extends StatefulWidget { @override State createState() => RRTMainScreenState(); } -class RRTMainScreenState extends State with SingleTickerProviderStateMixin{ - +class RRTMainScreenState extends State with SingleTickerProviderStateMixin { int currentIndex = 0; TabController tabController; PageController pageController = PageController(initialPage: 0, keepPage: true); @@ -22,84 +21,85 @@ class RRTMainScreenState extends State with SingleTickerProvider RRTViewModel viewModel; bool loadingData; + List imagesInfo = List(); + @override void initState() { super.initState(); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/RRT/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/RRT/ar/0.png')); tabController = TabController(length: 2, vsync: this); } TranslationBase localize; + @override Widget build(BuildContext context) { localize = TranslationBase.of(context); return AppScaffold( - appBarTitle: localize.rapidResponseTeam, - isShowAppBar: true, - body: BaseView( - onModelReady: (vm) async { - viewModel = vm; - loadingData = true; - await vm.loadRequiredData().then((value){ - }).whenComplete(() => setState(() => loadingData = false)); - }, - builder: (ctx, vm, widget) => content(), - ) - ); + appBarTitle: localize.rapidResponseTeam, + isShowAppBar: true, + description: TranslationBase.of(context).rrtDDetails, + imagesInfo: imagesInfo, + body: BaseView( + onModelReady: (vm) async { + viewModel = vm; + loadingData = true; + await vm.loadRequiredData().then((value) {}).whenComplete(() => setState(() => loadingData = false)); + }, + builder: (ctx, vm, widget) => content(), + )); } - Widget content(){ - if(loadingData == true){ + Widget content() { + if (loadingData == true) { return Center(child: CircularProgressIndicator()); // else if(viewModel.state == ViewState.Error) - }else if(viewModel.rrtServiceData != null && viewModel.rrtServiceData.servicePrice != null){ + } else if (viewModel.rrtServiceData != null && viewModel.rrtServiceData.servicePrice != null) { return Column( - children: [ - tabBar(), - Expanded( - child: contentPager() - ) - ], + children: [tabBar(), Expanded(child: contentPager())], ); - }else{ + } else { return Container( alignment: Alignment.center, - child: Text(localize.somethingWentWrongTryLater, style: TextStyle(color: Colors.red), maxLines: 5,), + child: Text( + localize.somethingWentWrongTryLater, + style: TextStyle(color: Colors.red), + maxLines: 5, + ), ); } } Widget tabBar() => Container( - margin: EdgeInsets.all(15), - clipBehavior: Clip.hardEdge, - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), - child: TabBar( - onTap: onPageChanged, - indicatorWeight: 3, - indicatorColor: Color(0xFFc5272d), - isScrollable: false, - controller: tabController, - indicatorSize: TabBarIndicatorSize.label, - tabs: [ + margin: EdgeInsets.all(15), + clipBehavior: Clip.hardEdge, + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), + child: TabBar(onTap: onPageChanged, indicatorWeight: 3, indicatorColor: Color(0xFFc5272d), isScrollable: false, controller: tabController, indicatorSize: TabBarIndicatorSize.label, tabs: [ Tab( - child: Text(localize.rapidResponseTeam, style: TextStyle(color: Theme.of(context).appBarTheme.color),), + child: Text( + localize.rapidResponseTeam, + style: TextStyle(color: Theme.of(context).appBarTheme.color), + ), ), Tab( - child: Text(localize.orderLog, style: TextStyle(color: Theme.of(context).appBarTheme.color),), + child: Text( + localize.orderLog, + style: TextStyle(color: Theme.of(context).appBarTheme.color), + ), ), - ] - ), - ); + ]), + ); Widget contentPager() => PageView( - onPageChanged: onPageChanged, - controller: pageController, - children: [ - RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders), - RRTLogPage(orders: viewModel.rrtServiceData.completedOrders), - ], - ); + onPageChanged: onPageChanged, + controller: pageController, + children: [ + RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders), + RRTLogPage(orders: viewModel.rrtServiceData.completedOrders), + ], + ); void onPageChanged(int index) { pageController.animateToPage(index, duration: Duration(milliseconds: 200), curve: Curves.easeInOut); diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index cf58e815..be87f5b8 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -46,7 +46,7 @@ class _InsuranceCardState extends State { infoList: TranslationBase.of(context).infoInsuranceCardsPoints, imagesInfo: imagesInfo, appBarIcons: [ - IconButton( + model.isLogin ? IconButton( padding: EdgeInsets.zero, icon: Container( decoration: BoxDecoration( @@ -64,7 +64,7 @@ class _InsuranceCardState extends State { onPressed: () { Navigator.push(context, FadePage(page: InsuranceUpdate())); }, - ), + ) : Container(), ], body: Container( margin: EdgeInsets.only(left: SizeConfig.screenWidth * 0.004, right: SizeConfig.screenWidth * 0.004, top: SizeConfig.screenWidth * 0.04), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index b64d2330..9ba5ad9c 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -1,11 +1,10 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; @@ -21,7 +20,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:feather_icons_flutter/feather_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -64,8 +62,7 @@ class _HomePageState extends State { width: double.infinity, height: 210, decoration: BoxDecoration( - image: DecorationImage( - image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover), + image: DecorationImage(image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover), ), child: Stack( children: [ @@ -84,8 +81,7 @@ class _HomePageState extends State { margin: EdgeInsets.all(5), decoration: BoxDecoration( image: DecorationImage( - image: - AssetImage("assets/images/new-design/covid_bg_transparent.png"), + image: AssetImage("assets/images/new-design/covid_bg_transparent.png"), fit: BoxFit.fill, ), color: Colors.white.withOpacity(0.3), @@ -115,10 +111,7 @@ class _HomePageState extends State { margin: EdgeInsets.only( top: 15.0, ), - child: SvgPicture.asset( - 'assets/images/new-design/covid-19-car.svg', - width: 45.0, - height: 45.0), + child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 45.0, height: 45.0), ), Container( margin: EdgeInsets.only(top: 5.0), @@ -140,12 +133,11 @@ class _HomePageState extends State { textColor: Colors.white, disabledTextColor: Colors.white, disabledColor: new Color(0xFFbcc2c4), - onPressed: - (model.user != null && model.user.outSA == 1) - ? () {} - : () { - navigateToCovidDriveThru(); - }, + onPressed: (model.user != null && model.user.outSA == 1) + ? () {} + : () { + navigateToCovidDriveThru(); + }, child: Center( child: Center( child: Center( @@ -177,13 +169,9 @@ class _HomePageState extends State { height: 125, padding: EdgeInsets.all(15), margin: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all(Radius.circular(5))), + decoration: BoxDecoration(color: Colors.white.withOpacity(0.3), borderRadius: BorderRadius.all(Radius.circular(5))), child: SvgPicture.asset( - projectViewModel.isArabic - ? 'assets/images/new-design/livecare_arabic_logo.svg' - : 'assets/images/new-design/liveCare_white_logo.svg', + projectViewModel.isArabic ? 'assets/images/new-design/livecare_arabic_logo.svg' : 'assets/images/new-design/liveCare_white_logo.svg', ), ), ), @@ -200,10 +188,8 @@ class _HomePageState extends State { ), Positioned( top: 155, - left: MediaQuery.of(context).size.width * - (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), - right: MediaQuery.of(context).size.width * - (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), + left: MediaQuery.of(context).size.width * (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), + right: MediaQuery.of(context).size.width * (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), child: (!model.isLogin) ? Container( width: double.infinity, @@ -213,8 +199,7 @@ class _HomePageState extends State { shape: BoxShape.rectangle, border: Border.all(color: Colors.transparent, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(9)), - image: DecorationImage( - image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)), + image: DecorationImage(image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)), child: Container( margin: EdgeInsets.all(5), child: Column( @@ -235,8 +220,7 @@ class _HomePageState extends State { fontSize: 16, ), Align( - alignment: - projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, + alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, child: InkWell( onTap: () { widget.goToMyProfile(); @@ -274,8 +258,7 @@ class _HomePageState extends State { shape: BoxShape.rectangle, border: Border.all(color: Colors.transparent, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(9)), - image: DecorationImage( - image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover), + image: DecorationImage(image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover), ), child: Container( margin: EdgeInsets.all(5), @@ -302,8 +285,7 @@ class _HomePageState extends State { ), Container( margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), - child: SvgPicture.asset( - "assets/images/new-design/verification_check.svg"), + child: SvgPicture.asset("assets/images/new-design/verification_check.svg"), ), ], ) @@ -318,8 +300,7 @@ class _HomePageState extends State { ), Container( margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), - child: SvgPicture.asset( - "assets/images/new-design/pending.svg"), + child: SvgPicture.asset("assets/images/new-design/pending.svg"), ), ], ) @@ -407,8 +388,7 @@ class _HomePageState extends State { width: 25, height: 40, ), - Texts('${model.weightKg} ${TranslationBase.of(context).kg}', - color: Colors.white, fontSize: 17) + Texts('${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 17) ], ), ), @@ -465,9 +445,7 @@ class _HomePageState extends State { ), ), ), - if (projectViewModel.havePrivilege(64) || - projectViewModel.havePrivilege(65) || - projectViewModel.havePrivilege(67)) + if (projectViewModel.havePrivilege(64) || projectViewModel.havePrivilege(65) || projectViewModel.havePrivilege(67)) Container( margin: EdgeInsets.only(left: 15, right: 15), child: Row( @@ -487,9 +465,7 @@ class _HomePageState extends State { }, child: Center( child: Padding( - padding: (model.user != null && model.user.outSA == 1) - ? const EdgeInsets.all(0.0) - : const EdgeInsets.all(15.0), + padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0), child: (model.user != null && model.user.outSA == 1) ? Container( width: double.infinity, @@ -526,13 +502,10 @@ class _HomePageState extends State { ), if (projectViewModel.havePrivilege(65)) DashboardItem( - onTap: () => - (model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model), + onTap: () => (model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model), child: Center( child: Padding( - padding: (model.user != null && model.user.outSA == 1) - ? const EdgeInsets.all(0.0) - : const EdgeInsets.all(15.0), + padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0), child: (model.user != null && model.user.outSA == 1) ? Container( width: double.infinity, @@ -587,9 +560,7 @@ class _HomePageState extends State { }, child: Center( child: Padding( - padding: (model.user != null && model.user.outSA == 1) - ? const EdgeInsets.all(0.0) - : const EdgeInsets.all(15.0), + padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0), child: (model.user != null && model.user.outSA == 1) ? Container( width: double.infinity, @@ -630,14 +601,14 @@ class _HomePageState extends State { SizedBox( height: 8, ), - InkWell( - onTap: () => Navigator.push(context, FadePage(page: PaymentService())), - child: Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: () => Navigator.push(context, FadePage(page: PaymentService())), + child: Container( width: MediaQuery.of(context).size.width * 0.29, child: Center( child: Padding( @@ -668,7 +639,12 @@ class _HomePageState extends State { color: Colors.white, ), ), - Container( + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: EReferralPage())); + }, + child: Container( child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -683,7 +659,7 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context).offersAndPackages, + TranslationBase.of(context).ereferral, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -699,51 +675,52 @@ class _HomePageState extends State { borderRadius: BorderRadius.circular(6.0), color: Colors.white, )), - if (projectViewModel.havePrivilege(60)) - Container( - width: MediaQuery.of(context).size.width * 0.29, - child: InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: ErOptions( - isAppbar: true, - ))), - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/Dr_Schedule_report.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).emergencyServices, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 1.7, - ) - ], - ), + ), + if (projectViewModel.havePrivilege(60)) + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: ErOptions( + isAppbar: true, + ))), + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/Dr_Schedule_report.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context).emergencyServices, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], ), ), ), - height: MediaQuery.of(context).size.width * 0.4, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Colors.white, - ), ), - ], - ), + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), + ), + ], ), ), + // ), SizedBox( height: 5, ), @@ -867,17 +844,7 @@ class _HomePageState extends State { } class DashboardItem extends StatelessWidget { - const DashboardItem( - {this.hasBorder = false, - this.imageName, - @required this.child, - this.onTap, - Key key, - this.width, - this.height, - this.color, - this.opacity = 0.4, - this.hasColorFilter = true}) + const DashboardItem({this.hasBorder = false, this.imageName, @required this.child, this.onTap, Key key, this.width, this.height, this.color, this.opacity = 0.4, this.hasColorFilter = true}) : super(key: key); final bool hasBorder; final String imageName; @@ -907,15 +874,12 @@ class DashboardItem extends StatelessWidget { : HexColor('#050705').withOpacity(opacity) : Colors.white, borderRadius: BorderRadius.circular(6.0), - border: hasBorder - ? Border.all(width: 1.0, color: const Color(0xffcccccc)) - : Border.all(width: 0.0, color: Colors.transparent), + border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( image: ExactAssetImage('assets/images/$imageName'), fit: BoxFit.cover, - colorFilter: - hasColorFilter ? new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, + colorFilter: hasColorFilter ? new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, ) : null, ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index b8607a89..d57e3da7 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -105,7 +105,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (currentTab > 0 && tab == 2) pageController.jumpToPage(0); else if (tab != 0) { - if (tab == 4 && model.count == 0) { + if (tab == 4 && projectViewModel.isLogin && model.count == 0) { AppToast.showErrorToast( message: TranslationBase.of(context).noBookedAppo); } else { diff --git a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart index 902225b1..bf892940 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -1,10 +1,6 @@ import 'dart:ui'; -import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -19,8 +15,7 @@ class AskDoctorHomPage extends StatefulWidget { _AskDoctorHomPageState createState() => _AskDoctorHomPageState(); } -class _AskDoctorHomPageState extends State - with SingleTickerProviderStateMixin { +class _AskDoctorHomPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; @override @@ -40,6 +35,12 @@ class _AskDoctorHomPageState extends State return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).askDoctor, + isShowDecPage: true, + description: TranslationBase.of(context).infoAskDoc, + imagesInfo: [ + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/ask-doctor/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/ask-doctor/ar/0.png'), + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/ask-doctor/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/ask-doctor/ar/1.png') + ], body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -53,9 +54,7 @@ class _AskDoctorHomPageState extends State child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), + color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8), height: 70.0, ), ), @@ -67,9 +66,7 @@ class _AskDoctorHomPageState extends State width: MediaQuery.of(context).size.width * 0.9, decoration: BoxDecoration( border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), + bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), ), color: Colors.white), child: Center( @@ -80,22 +77,27 @@ class _AskDoctorHomPageState extends State labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), unselectedLabelColor: Colors.grey[800], - tabs: [ - Tab( - child: Container( - width: MediaQuery.of(context).size.width * 0.36, - child: Center( - child: Texts(TranslationBase.of(context).askDoctor), - ), + tabs: [ + Tab( + child: Container( + width: MediaQuery.of(context).size.width * 0.36, + child: Center( + child: Texts(TranslationBase.of(context).askDoctor), ), ), - Tab(child: Container( - width: MediaQuery.of(context).size.width * 0.36, + ), + Tab( + child: Container( + width: MediaQuery.of(context).size.width * 0.36, child: Center( - child: Texts(TranslationBase.of(context).doctorResponses,textAlign: TextAlign.start,), + child: Texts( + TranslationBase.of(context).doctorResponses, + textAlign: TextAlign.start, + ), ), - ),) - ], + ), + ) + ], ), ), ), @@ -109,10 +111,7 @@ class _AskDoctorHomPageState extends State child: TabBarView( physics: BouncingScrollPhysics(), controller: _tabController, - children: [ - AskDoctorPage(), - DoctorResponse() - ], + children: [AskDoctorPage(), DoctorResponse()], ), ) ], diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index d3921d4a..d1d0293b 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -72,6 +72,7 @@ class _AdvancePaymentPageState extends State { imagesInfo: imagesInfo, appBarTitle: TranslationBase.of(context).advancePayment, description: TranslationBase.of(context).infoAdvancePayment, + isBottomBar: model.isLogin ? true : false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/medical/eye/EyeMeasurementsPage.dart b/lib/pages/medical/eye/EyeMeasurementsPage.dart index 8dbe0f16..66ea0da7 100644 --- a/lib/pages/medical/eye/EyeMeasurementsPage.dart +++ b/lib/pages/medical/eye/EyeMeasurementsPage.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -24,6 +25,12 @@ class EyeMeasurementsPage extends StatelessWidget { builder: (_, model, w) => AppScaffold( isShowAppBar: true, baseViewModel: model, + description: TranslationBase.of(context).infoEye, + imagesInfo: [ + ImagesInfo( + imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/eye-measurements/ar/0.png', + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/eye-measurements/en/0.png') + ], appBarTitle: TranslationBase.of(context).eyeMeasurements, body: SingleChildScrollView( child: Container( diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart index 2af80adc..b49879bc 100644 --- a/lib/pages/medical/my_invoices/my_invoice_page.dart +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart' as DoctorListResponse; @@ -24,21 +25,28 @@ class _MyInvoicesState extends State { GetDentalAppointmentsResponse getDentalAppointmentsResponse; DentalInvoiceDetailResponse dentalInvoiceDetailResponse; + ProjectViewModel projectViewModel; + List imagesInfo = List(); + @override void initState() { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-invoice/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-invoice/ar/0.png')); + WidgetsBinding.instance.addPostFrameCallback((_) { - getDentalAppointments(); + if(projectViewModel.isLogin) + getDentalAppointments(); }); super.initState(); } @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).myInvoice, isShowAppBar: true, isShowDecPage: true, + imagesInfo: imagesInfo, body: Container( child: SingleChildScrollView( physics: BouncingScrollPhysics(), diff --git a/lib/pages/medical/my_trackers/my_trackers.dart b/lib/pages/medical/my_trackers/my_trackers.dart index c133c67a..b9450fd5 100644 --- a/lib/pages/medical/my_trackers/my_trackers.dart +++ b/lib/pages/medical/my_trackers/my_trackers.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -15,7 +16,11 @@ class MyTrackers extends StatelessWidget { return AppScaffold( appBarTitle: TranslationBase.of(context).myTracker, isShowAppBar: true, - isShowDecPage: false, + isShowDecPage: true, + description: TranslationBase.of(context).infoTrackers, + imagesInfo: [ + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-trackers/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-trackers/ar/0.png') + ], body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(12), @@ -33,8 +38,7 @@ class MyTrackers extends StatelessWidget { margin: EdgeInsets.all(5), width: MediaQuery.of(context).size.width * 0.35, height: MediaQuery.of(context).size.width * 0.35, - decoration: BoxDecoration( - shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), + decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -59,8 +63,7 @@ class MyTrackers extends StatelessWidget { margin: EdgeInsets.all(5), width: MediaQuery.of(context).size.width * 0.35, height: MediaQuery.of(context).size.width * 0.35, - decoration: BoxDecoration( - shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), + decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -90,8 +93,7 @@ class MyTrackers extends StatelessWidget { margin: EdgeInsets.all(5), width: MediaQuery.of(context).size.width * 0.35, height: MediaQuery.of(context).size.width * 0.35, - decoration: BoxDecoration( - shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), + decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart index 80f6ac76..f6635063 100644 --- a/lib/pages/medical/reports/monthly_reports.dart +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart'; @@ -24,6 +25,23 @@ class _MonthlyReportsPageState extends State { String email; final formKey = GlobalKey(); + List imagesInfo = List(); + + @override + void initState() { + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/monthly-reports/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/monthly-reports/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/monthly-reports/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/monthly-reports/ar/1.png')); + super.initState(); + } + @override Widget build(BuildContext context) { return BaseView(builder: (_, model, w) { @@ -39,6 +57,8 @@ class _MonthlyReportsPageState extends State { return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).monthlyReports, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).infoMonthReport, body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(12), diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart index 977b99df..057c6be6 100644 --- a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -1,9 +1,13 @@ import 'dart:io'; import 'package:carousel_slider/carousel_slider.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart'; import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -19,10 +23,13 @@ class _SmartWatchInstructionsState extends State { bool hasAlreadySynced = false; + AuthenticatedUserObject authenticatedUserObject = + locator(); + @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - getLastPatientRecord(context); + if(authenticatedUserObject.isLogin) getLastPatientRecord(context); }); super.initState(); } @@ -32,6 +39,12 @@ class _SmartWatchInstructionsState extends State { return AppScaffold( appBarTitle: "Sync Health Data", isShowAppBar: true, + isShowDecPage: true, + description: TranslationBase.of(context).infoHealthData, + imagesInfo: [ + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/ar/0.png'), + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/ar/1.png') + ], body: Container( child: Platform.isIOS ? _getAppleWatchInstructions() diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart index 27ce8399..4b71b0b7 100644 --- a/lib/pages/vaccine/my_vaccines_screen.dart +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -1,19 +1,19 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../base/base_view.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; -import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'package:popup_box/popup_box.dart'; +import '../base/base_view.dart'; import 'my_vaccines_item_screen.dart'; //TODO fix by jammal we have a static data @@ -28,192 +28,164 @@ class _MyVaccinesState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getVaccine(), - builder: (BuildContext context, VaccineViewModel model, Widget child) => - AppScaffold( - isShowAppBar: true, - baseViewModel: model, - appBarTitle: TranslationBase.of(context).myVaccines, - body: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: Column( - children: [ - RoundedContainer( - backgroundColor: Colors.white, - child: ExpansionTile( - title: Container( - height: 65.0, - child: Text('2018'), - ), - children: [ - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.vaccineList == null - ? 0 - : model.vaccineList.length, - itemBuilder: (BuildContext context, int index) { - return Column( - children: [ - RoundedContainer( - child: Column( + builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).myVaccines, + description: TranslationBase.of(context).infoVaccines, + imagesInfo: [ + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vacceines/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vacceines/ar/0.png') + ], + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + RoundedContainer( + backgroundColor: Colors.white, + child: ExpansionTile( + title: Container( + height: 65.0, + child: Text('2018'), + ), + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.vaccineList == null ? 0 : model.vaccineList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + RoundedContainer( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: Column( - children: [ - Padding( - padding: EdgeInsets - .symmetric( - horizontal: - 20.0, - vertical: 20.0), - child: Image.network( - model - .vaccineList[ - index] - .doctorImageURL, - height: SizeConfig - .imageSizeMultiplier * - 23, - width: SizeConfig - .imageSizeMultiplier * - 20, - fit: BoxFit.fill, - ), - ), - ], - ), - flex: 2, - ), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Text( - model - .vaccineList[ - index] - .doctorTitle + - model - .vaccineList[ - index] - .doctorName, - style: TextStyle( - fontWeight: - FontWeight.w900, - fontSize: 16.6, - ), - ), - SizedBox(height: 7.0), - Text( - model - .vaccineList[ - index] - .projectName, - style: TextStyle( - fontSize: 17.0, - letterSpacing: 0.5, - ), - ), - SizedBox(height: 7.0), - Text( - model - .vaccineList[ - index] - .vaccineName, - style: TextStyle( - fontSize: 17.0, - ), - ), - SizedBox(height: 7.0), - Text( - 'Date Taken ' + - convertDateFormat(model - .vaccineList[ - index] - .invoiceDate), - style: TextStyle( - fontSize: 17.0), - ), - ], + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0), + child: Image.network( + model.vaccineList[index].doctorImageURL, + height: SizeConfig.imageSizeMultiplier * 23, + width: SizeConfig.imageSizeMultiplier * 20, + fit: BoxFit.fill, ), ), - flex: 5, + ], + ), + flex: 2, + ), + Expanded( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + model.vaccineList[index].doctorTitle + model.vaccineList[index].doctorName, + style: TextStyle( + fontWeight: FontWeight.w900, + fontSize: 16.6, + ), + ), + SizedBox(height: 7.0), + Text( + model.vaccineList[index].projectName, + style: TextStyle( + fontSize: 17.0, + letterSpacing: 0.5, + ), + ), + SizedBox(height: 7.0), + Text( + model.vaccineList[index].vaccineName, + style: TextStyle( + fontSize: 17.0, + ), + ), + SizedBox(height: 7.0), + Text( + 'Date Taken ' + convertDateFormat(model.vaccineList[index].invoiceDate), + style: TextStyle(fontSize: 17.0), + ), + ], ), - ], + ), + flex: 5, ), ], ), - ), - ], - ); - }), - ) - ], - ), - ), - // SpaceBetweenTexts(space: 165.0), - ], + ], + ), + ), + ], + ); + }), + ) + ], + ), ), - ), - bottomSheet: model.state == ViewState.Busy?Container(height: 0,): model.vaccineList.length > 0 + // SpaceBetweenTexts(space: 165.0), + ], + ), + ), + bottomSheet: model.state == ViewState.Busy + ? Container( + height: 0, + ) + : model.vaccineList.length > 0 ? Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(12), - height: MediaQuery.of(context).size.height * 0.25, - width: double.infinity, - child: Column( - children: [ - Divider( - height: 2, - thickness: 1, - ), - SizedBox( - height: 6, - ), - Container( + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12), + height: MediaQuery.of(context).size.height * 0.25, width: double.infinity, - // height: 80.0, - child: Button( - disabled: true, - label: TranslationBase.of(context) - .checkVaccineAvailability, - backgroundColor: Color(0xff9EA3A4), - onTap: () => Navigator.push( - context, FadePage(page: MyVaccinesItemPage())), + child: Column( + children: [ + Divider( + height: 2, + thickness: 1, + ), + SizedBox( + height: 6, + ), + Container( + width: double.infinity, + // height: 80.0, + child: Button( + disabled: true, + label: TranslationBase.of(context).checkVaccineAvailability, + backgroundColor: Color(0xff9EA3A4), + onTap: () => Navigator.push(context, FadePage(page: MyVaccinesItemPage())), + ), + ), + if (projectViewModel.havePrivilege(27)) + Container( + width: double.infinity, + // height: 80.0, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + color: Color(0xffF62426), + textColor: Colors.white, + disabled: model.vaccineList.length == 0, + loading: model.state == ViewState.BusyLocal, + onTap: () async { + model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully); + }, + ), + ), + ], ), + ) + : Container( + height: 0, ), - if (projectViewModel.havePrivilege(27)) - Container( - width: double.infinity, - // height: 80.0, - child: SecondaryButton( - label: TranslationBase.of(context).sendEmail, - color: Color(0xffF62426), - textColor: Colors.white, - disabled: model.vaccineList.length == 0, - loading: model.state == ViewState.BusyLocal, - onTap: () async { - model.sendEmail( - message: TranslationBase.of(context) - .emailSentSuccessfully); - }, - ), - ), - ], - ), - ) - : Container(height: 0,), - ), + ), ); } @@ -224,13 +196,8 @@ class _MyVaccinesState extends State { final startIndex = Date.indexOf(start); final endIndex = Date.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(Date.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(Date.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + "-" + date.month.toString().padLeft(2, '0') + "-" + date.day.toString().padLeft(2, '0'); return newDate.toString(); } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 06b661e0..6514a435 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1747,6 +1747,24 @@ class TranslationBase { String get timeNeeded => localizedValues["time-needed"][locale.languageCode]; String get totalTimeNeeded => localizedValues["total-time-needed"][locale.languageCode]; + String get infoEye => + localizedValues["info-eye"][locale.languageCode]; + String get infoVaccines => + localizedValues["info-vaccines"][locale.languageCode]; + String get infoTrackers => + localizedValues["info-trackers"][locale.languageCode]; + String get infoHealthData => + localizedValues["info-health-data"][locale.languageCode]; + String get infoAskDoc => + localizedValues["info-ask-doc"][locale.languageCode]; + String get infoAutoWifi => + localizedValues["info-auto-wifi"][locale.languageCode]; + String get autoWifi => + localizedValues["auto-wifi"][locale.languageCode]; + String get childVaccineInfo => + localizedValues["child-vaccine-info"][locale.languageCode]; + String get h2oInfo => + localizedValues["h2o-info"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 980761b4..cff955b9 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -7,6 +7,7 @@ import 'package:badges/badges.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:connectivity/connectivity.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; @@ -20,7 +21,6 @@ import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart' import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/eye/EyeMeasurementsPage.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_invoices/my_invoice_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/my_trackers.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; @@ -31,15 +31,15 @@ import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:url_launcher/url_launcher.dart'; + import '../Constants.dart'; import 'app_shared_preferences.dart'; import 'app_toast.dart'; @@ -240,8 +240,7 @@ class Utils { } medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, + onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).radiology, imagePath: 'radiology_icon.png', @@ -251,8 +250,7 @@ class Utils { )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, + onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).medicines, imagePath: 'prescription_icon.png', @@ -277,8 +275,7 @@ class Utils { )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null, + onTap: () => projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).myMedical, imagePath: 'active_medications.png', @@ -297,15 +294,11 @@ class Utils { ) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).myDoctor, - imagePath: 'doctor_icon.png', - subTitle: TranslationBase.of(context).myDoctorSubtitle, - isEnable: projectViewModel.havePrivilege(6)), + title: TranslationBase.of(context).myDoctor, imagePath: 'doctor_icon.png', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null, + onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).myInvoice, imagePath: 'Invoice.png', @@ -315,8 +308,7 @@ class Utils { )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null, + onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).eye, imagePath: 'eye_measurement_icon.png', @@ -347,8 +339,7 @@ class Utils { )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null, + onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).insuranceApproval, imagePath: 'insurance_approvals_icon.png', @@ -378,8 +369,7 @@ class Utils { )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null, + onTap: () => projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).medical, imagePath: 'medical_reports_icon.png', @@ -389,8 +379,7 @@ class Utils { )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null, + onTap: () => projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).monthly, imagePath: 'monthly_reports_icon.png', @@ -400,8 +389,7 @@ class Utils { )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null, + onTap: () => projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).sick, imagePath: 'sick_leaves_icons.png', @@ -439,8 +427,7 @@ class Utils { )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null, + onTap: () => projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null, child: MedicalProfileItem( title: TranslationBase.of(context).smartWatches, imagePath: 'smartwatch_icon.png', @@ -450,36 +437,34 @@ class Utils { )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null, + onTap: () => projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null, child: MedicalProfileItem( - title: TranslationBase.of(context).askYour, - imagePath: 'ask_doctor_icon.png', - subTitle: TranslationBase.of(context).askYourSubtitle, - isEnable: projectViewModel.havePrivilege(28)), + title: TranslationBase.of(context).askYour, imagePath: 'ask_doctor_icon.png', subTitle: TranslationBase.of(context).askYourSubtitle, isEnable: projectViewModel.havePrivilege(28)), )); if (projectViewModel.havePrivilege(32) || true) { medical.add(InkWell( onTap: () { - userData().then((userData_) { - if (projectViewModel.isLogin && userData_ != null) { + if (projectViewModel.isLogin) { + userData().then((userData_) { String patientID = userData_.patientID.toString(); GifLoaderDialogUtils.showMyDialog(context); - projectViewModel - .platformBridge() - .connectHMGInternetWifi(patientID) - .then((value) => {GifLoaderDialogUtils.hideDialog(context)}); - } else { - AlertDialogBox( - context: context, - confirmMessage: "Please login with your account first to use this feature", - okText: "OK", - okFunction: () { - AlertDialogBox.closeAlertDialog(context); - }).showAlertDialog(context); - } - }); + projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}); + }); + } else { + Navigator.push( + context, + FadePage( + page: NotAutPage( + title: TranslationBase.of(context).autoWifi, + description: TranslationBase.of(context).infoAutoWifi, + infoList: [], + imagesInfo: [ + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/connect-to/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/connect-to/ar/0.png'), + ], + ))); + } }, child: MedicalProfileItem( title: TranslationBase.of(context).internet, @@ -517,21 +502,15 @@ class Utils { }); } - static bool route(Route route, {@required Type equalsTo}){ - if((route is FadePage)){ + static bool route(Route route, {@required Type equalsTo}) { + if ((route is FadePage)) { return route.page.runtimeType == equalsTo; } return route.runtimeType == equalsTo; } } -Widget applyShadow( - {Color color = Colors.grey, - double shadowOpacity = 0.5, - double spreadRadius = 2, - double blurRadius = 7, - Offset offset = const Offset(2, 2), - @required Widget child}) { +Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) { return Container( decoration: BoxDecoration( boxShadow: [ @@ -571,19 +550,18 @@ openAppStore({String androidPackageName, String iOSAppID}) async { } } -String labelFrom({@required String className}){ +String labelFrom({@required String className}) { RegExp exp = RegExp(r'(?<=[a-z])[A-Z]'); String result = className.replaceAllMapped(exp, (m) { var str = m.group(0); - if(str != null){ + if (str != null) { return ('_' + str); } return ""; }); - if(result.isEmpty) - return className; + if (result.isEmpty) return className; result = result.replaceAll("_", " "); return result; diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 7c0c69d4..48ea6819 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -15,8 +15,6 @@ import 'package:provider/provider.dart'; import '../../d_q_icons_icons.dart'; import 'bottom_navigation_item.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index 9a3bbafe..91aefc75 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -2,7 +2,6 @@ import 'package:badges/badges.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; From d1b7c94d6e12837824e19e29ce68c9650b35660b Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 5 Sep 2021 17:34:27 +0300 Subject: [PATCH 5/5] improvement. --- lib/uitl/utils.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 6cdd8ebe..5259837a 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -34,6 +34,7 @@ import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart';