From f577905dcbada771dba26fe6ea8bf1e0645e1ed0 Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Sun, 5 Sep 2021 14:47:37 +0300 Subject: [PATCH] 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, ), ), ),