From c84707ba3fd4bdfec9e0af298514af74dd09c6cf Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 7 Sep 2021 15:25:07 +0300 Subject: [PATCH] monthly report request & sick leaves ui redesigned. --- .../landing/fragments/home_page_fragment.dart | 2 +- .../fragments/home_page_fragment2.dart | 8 +- .../fragments/logged_home_page_fragment.dart | 5 +- lib/pages/login/login.dart | 2 - .../medical/patient_sick_leave_page.dart | 36 +-- .../medical/reports/monthly_reports.dart | 13 +- .../medical/reports/report_home_page.dart | 1 + lib/pages/medical/reports/reports_page.dart | 241 ++++++++++++------ lib/uitl/utils.dart | 12 +- 9 files changed, 205 insertions(+), 115 deletions(-) diff --git a/lib/pages/landing/fragments/home_page_fragment.dart b/lib/pages/landing/fragments/home_page_fragment.dart index c5ad8dad..9f92a86b 100644 --- a/lib/pages/landing/fragments/home_page_fragment.dart +++ b/lib/pages/landing/fragments/home_page_fragment.dart @@ -36,7 +36,7 @@ class _HomePageFragmentState extends State { hmgServices.add(new HmgServices(2, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", 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).refferal, TranslationBase.of(context).services2, "assets/images/new/E_Refferal.svg", isLogin)); - hmgServices.add(new HmgServices(5, "RRT", TranslationBase.of(context).emergency, "assets/images/new/RRT.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services, "assets/images/new/RRT.svg", isLogin)); } @override diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 374a69e5..68bf2ffe 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,onMedicalFileClick; + Function onPharmacyClick, onLoginClick, onMedicalFileClick; - HomePageFragment2(this.model, {this.onLoginClick, this.onPharmacyClick,this.onMedicalFileClick}); + HomePageFragment2(this.model, {this.onLoginClick, this.onPharmacyClick, this.onMedicalFileClick}); @override _HomePageFragment2State createState() => _HomePageFragment2State(); @@ -55,7 +55,7 @@ class _HomePageFragment2State extends State { 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(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services2, "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)); @@ -130,7 +130,7 @@ class _HomePageFragment2State extends State { FlatButton( onPressed: () { widget.onMedicalFileClick(); - // navigateTo(context, MedicalProfilePageNew()); + // navigateTo(context, MedicalProfilePageNew()); }, child: Text( TranslationBase.of(context).viewMedicalFile, diff --git a/lib/pages/landing/fragments/logged_home_page_fragment.dart b/lib/pages/landing/fragments/logged_home_page_fragment.dart index eff13328..92f3e960 100644 --- a/lib/pages/landing/fragments/logged_home_page_fragment.dart +++ b/lib/pages/landing/fragments/logged_home_page_fragment.dart @@ -61,7 +61,7 @@ class _HomePageFragmentState extends State { hmgServices.add(new HmgServices(2, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", 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).refferal, TranslationBase.of(context).services2, "assets/images/new/E_Refferal.svg", isLogin)); - hmgServices.add(new HmgServices(5, "RRT", TranslationBase.of(context).emergency, "assets/images/new/RRT.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services, "assets/images/new/RRT.svg", isLogin)); } Future getFamilyFiles() async { @@ -93,7 +93,8 @@ class _HomePageFragmentState extends State { child: LoggedSliderView( widget.projectViewModel, new SliderData(TranslationBase.of(context).fileno + ": " + widget.projectViewModel.user.patientID.toString(), - widget.projectViewModel.user.firstName + ' ' + widget.projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor),null), + widget.projectViewModel.user.firstName + ' ' + widget.projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor), + null), ), ), appoCountProvider.count == 0 diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index bcb91ee1..cf5d2505 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -224,7 +224,6 @@ class _Login extends State { } void validateForm() { - print("mobileNo:${mobileNo}"); if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { setState(() { isButtonDisabled = false; @@ -234,7 +233,6 @@ class _Login extends State { isButtonDisabled = true; }); } - print("isButtonDisabled:${isButtonDisabled}"); } checkUserAuthentication() { diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 29ed02f5..ac9a4ea8 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -37,24 +37,28 @@ class _PatientSickLeavePageState extends State { appBarTitle: TranslationBase.of(context).sickLeaves, description: TranslationBase.of(context).infoSickLeaves, infoList: TranslationBase.of(context).infoSickLeavePoints, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), imagesInfo: imagesInfo, baseViewModel: model, - body: Container( - margin: EdgeInsets.all(12), - child: ListView.builder( - itemCount: model.sickLeaveList.length, - itemBuilder: (context, index) => DoctorCard( - isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment, - name: model.sickLeaveList[index].doctorName, - date: model.sickLeaveList[index].appointmentDate, - profileUrl: model.sickLeaveList[index].doctorImageURL, - rating: model.sickLeaveList[index].actualDoctorRate.toDouble(), - subName: model.sickLeaveList[index].projectName, - isInOutPatient: model.sickLeaveList[index].isInOutPatient, - onEmailTap: () { - showConfirmMessage(model, index); - }, - ), + body: ListView.separated( + physics: BouncingScrollPhysics(), + itemCount: model.sickLeaveList.length, + padding: EdgeInsets.all(21), + separatorBuilder: (context, index) => SizedBox(height: 14), + itemBuilder: (context, index) => DoctorCard( + isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment, + name: model.sickLeaveList[index].doctorName, + date: model.sickLeaveList[index].appointmentDate, + profileUrl: model.sickLeaveList[index].doctorImageURL, + rating: model.sickLeaveList[index].actualDoctorRate.toDouble(), + subName: model.sickLeaveList[index].clinicName, + isSortByClinic: false, + isInOutPatient: model.sickLeaveList[index].isInOutPatient, + onEmailTap: () { + showConfirmMessage(model, index); + }, ), ), ), diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart index f6635063..d8576a51 100644 --- a/lib/pages/medical/reports/monthly_reports.dart +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -30,15 +30,9 @@ class _MonthlyReportsPageState extends State { @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')); + 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')); + 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(); } @@ -57,6 +51,9 @@ class _MonthlyReportsPageState extends State { return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).monthlyReports, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), imagesInfo: imagesInfo, description: TranslationBase.of(context).infoMonthReport, body: SingleChildScrollView( diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 69db0edb..e24e9ac7 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -56,6 +56,7 @@ class _HomeReportPageState extends State with SingleTickerProvid baseViewModel: model, showNewAppBar: true, showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), imagesInfo: imagesInfo, body: Column( children: [ diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index 11d5fc82..682e6fe1 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -5,26 +5,28 @@ import 'package:diplomaticquarterapp/pages/feedback/appointment_history.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_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'; class MedicalReports extends StatelessWidget { @override Widget build(BuildContext context) { - void confirmBox( - AppointmentHistory model, ReportsViewModel reportsViewModel) { + void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) { showDialog( context: context, child: ConfirmDialog( appointmentHistory: model, - onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model,TranslationBase.of(context).successSendReport), + onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), ), ); } + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPatentAppointmentHistory(), @@ -32,88 +34,175 @@ class MedicalReports extends StatelessWidget { baseViewModel: model, isShowAppBar: true, appBarTitle: TranslationBase.of(context).medReport, - body: ListView.builder( - itemCount: model.appointHistoryList.length, - itemBuilder: (context, index) => Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - width: double.infinity, - margin: EdgeInsets.only(left: 8, right: 8, top: 3), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.white, width: 2), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all( - Radius.circular(8.0), - )), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5, right: 5), - child: LargeAvatar( - width: 50, - height: 50, - name: model.appointHistoryList[index].doctorNameObj, - url: model.appointHistoryList[index].doctorImageURL, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), + body: ListView.separated( + physics: BouncingScrollPhysics(), + itemCount: model.appointHistoryList.length, + padding: EdgeInsets.all(21), + separatorBuilder: (context, index) => SizedBox(height: 14), + itemBuilder: (context, index) { + AppointmentHistory _appointmenHistory = model.appointHistoryList[index]; + + return InkWell( + onTap: () => confirmBox(model.appointHistoryList[index], model), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) + Text( + (_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + Text( + DateUtil.formatDateToDate(_appointmenHistory.appointmentDate), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ), + ], + ), + if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + LargeAvatar( + name: _appointmenHistory.doctorName, + url: _appointmenHistory.doctorImageURL, + width: 48, + height: 48, + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName), + if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RatingBar.readOnly( + initialRating: _appointmenHistory.actualDoctorRate.toDouble(), + size: 16.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + Icon(Icons.email, color: Color(0xff2B353E)) + ], + ), + ], + ), + ), + ], + ), + ], ), ), - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Texts(model.appointHistoryList[index].projectName), - Texts(model.appointHistoryList[index].clinicName), - Texts(projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate):DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)), - StarRating( - totalAverage: model - .appointHistoryList[index].actualDoctorRate - .toDouble(), - forceStars: true), - SizedBox( - height: 12, - ), - ], + ), + ); + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(left: 5, right: 5), + child: LargeAvatar( + width: 50, + height: 50, + name: model.appointHistoryList[index].doctorNameObj, + url: model.appointHistoryList[index].doctorImageURL, ), ), - ), - InkWell( - onTap: () => - confirmBox(model.appointHistoryList[index], model), - child: Container( - width: 120, - height: 50, - decoration: BoxDecoration( - color: Colors.black54, - border: - Border.all(color: Colors.transparent, width: 2), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all( - Radius.circular(8.0), + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts(model.appointHistoryList[index].projectName), + Texts(model.appointHistoryList[index].clinicName), + Texts(projectViewModel.isArabic + ? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate) + : DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)), + StarRating(totalAverage: model.appointHistoryList[index].actualDoctorRate.toDouble(), forceStars: true), + SizedBox( + height: 12, + ), + ], ), ), - child: Center( - child: Texts( - TranslationBase.of(context).requestReport, - fontSize: 12, - color: Colors.white, + ), + InkWell( + onTap: () => confirmBox(model.appointHistoryList[index], model), + child: Container( + width: 120, + height: 50, + decoration: BoxDecoration( + color: Colors.black54, + border: Border.all(color: Colors.transparent, width: 2), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).requestReport, + fontSize: 12, + color: Colors.white, + ), ), ), ), - ), - SizedBox( - width: 12, - ), - ], - ), - ), - ), - ), + SizedBox( + width: 12, + ), + ], + ), + ); + }), ), ); } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 5259837a..8a40aec0 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -409,12 +409,12 @@ class Utils { ), )); - medical.add(MedicalProfileItem( - title: TranslationBase.of(context).patientCall, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context).patientCallSubtitle, - isEnable: projectViewModel.havePrivilege(61), - )); + // medical.add(MedicalProfileItem( + // title: TranslationBase.of(context).patientCall, + // imagePath: 'medical_history_icon.png', + // subTitle: TranslationBase.of(context).patientCallSubtitle, + // isEnable: projectViewModel.havePrivilege(61), + // )); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null,