From 70b3776aa77948055b4394873db7df7c274b2301 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 9 Dec 2021 11:52:51 +0200 Subject: [PATCH 1/3] fix tabs --- .../referral/patient_referral_screen.dart | 111 ++++-------------- 1 file changed, 24 insertions(+), 87 deletions(-) diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index de1d5958..f4459dba 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -2,6 +2,7 @@ import 'dart:ui'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -17,10 +18,10 @@ class PatientReferralScreen extends StatefulWidget { _PatientReferralScreen createState() => _PatientReferralScreen(); } -class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { - +class _PatientReferralScreen extends State + with SingleTickerProviderStateMixin { TabController _tabController; - int index=0; + int index = 0; @override void initState() { @@ -41,7 +42,6 @@ class _PatientReferralScreen extends State with SingleTic _tabController.dispose(); } - @override Widget build(BuildContext context) { return AppScaffold( @@ -51,17 +51,11 @@ class _PatientReferralScreen extends State with SingleTic extendBodyBehindAppBar: true, // backgroundColor: Colors.white, appBar: PreferredSize( - preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + preferredSize: + Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Center( child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 1), //width: 0.7 - ), - color: Colors.white), + height: Helpers.getTabHeight(context), child: Center( child: TabBar( isScrollable: false, @@ -69,93 +63,36 @@ class _PatientReferralScreen extends State with SingleTic indicatorColor: Colors.transparent, indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), + labelPadding: + EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.33, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + decoration: Helpers.getBoxTabsBoxDecoration( + isActive: index == 0, isFirst: true), child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - index == 0 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), - index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - TranslationBase.of(context).myReferredPatient, - fontSize: SizeConfig.textMultiplier * 1.8, - color: index == 0 ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), - ), + child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) ), ), - Container( - width: MediaQuery.of(context).size.width * 0.34, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - index == 1 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), - index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - TranslationBase.of(context).referral, - fontSize: SizeConfig.textMultiplier * 1.8, - color: index == 1 ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), + Center( + child: Container( + decoration:Helpers.getBoxTabsBoxDecoration( + isActive: index == 1, isMiddle: true), + child: Center( + child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) ), ), ), - Container( - width: MediaQuery.of(context).size.width * 0.33, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - index == 2 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), - index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - TranslationBase.of(context).discharged, - fontSize: SizeConfig.textMultiplier * 1.8, - color: index == 2 ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), + Center( + child: Container( + decoration:Helpers.getBoxTabsBoxDecoration( + isActive: index == 2, isLast: true), + child: Center( + child: Helpers.getTabText(title:TranslationBase.of(context).discharged, isActive:index == 2 ), ), ), ), - ], ), ), From af10c60a7e329e19ccb0a1ce9292c2798f05fd87 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 9 Dec 2021 12:00:36 +0200 Subject: [PATCH 2/3] fix merge issue in patient_referral_screen.dart --- .../referral/patient_referral_screen.dart | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 7454bcde..bb9db904 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -46,15 +46,17 @@ class _PatientReferralScreen extends State @override Widget build(BuildContext context) { return AppScaffold( + isShowAppBar: true, appBar: PatientSearchHeader( title: TranslationBase.of(context).patientsreferral, ), + appBarTitle: TranslationBase.of(context).patientsreferral, body: Scaffold( extendBodyBehindAppBar: true, // backgroundColor: Colors.white, appBar: PreferredSize( preferredSize: - Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Center( child: Container( height: Helpers.getTabHeight(context), @@ -67,14 +69,14 @@ class _PatientReferralScreen extends State indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), + EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( decoration: Helpers.getBoxTabsBoxDecoration( isActive: index == 0, isFirst: true), child: Center( - child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) + child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) ), ), Center( @@ -82,7 +84,7 @@ class _PatientReferralScreen extends State decoration:Helpers.getBoxTabsBoxDecoration( isActive: index == 1, isMiddle: true), child: Center( - child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) + child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) ), ), ), @@ -101,20 +103,22 @@ class _PatientReferralScreen extends State ), ), ), - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - ReferredPatientScreen(), - MyReferralInPatientScreen(), - ReferralDischargedPatientPage() - // MyReferredPatient(), - ], - ), - ) - ], - ), - ); + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + ReferredPatientScreen(), + MyReferralInPatientScreen(), + ReferralDischargedPatientPage() + // MyReferredPatient(), + ], + ), + ) + ], + ), + )); } } From c2fbd99cede6d57d52a51e36e907eb3130c2385d Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 9 Dec 2021 14:15:51 +0200 Subject: [PATCH 3/3] small fixes --- lib/config/localized_values.dart | 2 +- .../my-referral-inpatient-screen.dart | 200 +++++++++--------- lib/widgets/auth/method_type_card.dart | 6 +- lib/widgets/dashboard/activity_button.dart | 4 +- lib/widgets/dashboard/out_patient_stack.dart | 2 +- .../patient-referral-item-widget.dart | 2 +- .../profile/PatientProfileButton.dart | 2 +- 7 files changed, 113 insertions(+), 105 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3fa70057..09562b9f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -53,7 +53,7 @@ const Map> localizedValues = { "service": {"en": "Service", "ar": "خدمة"}, "referral": {"en": "Referral", "ar": "الإحالة"}, "inPatient": {"en": "In Patients", "ar": "مرضاي"}, - "myInPatient": {"en": "My\n Patients", "ar": "مرضاي\nالمنومين"}, + "myInPatient": {"en": "My\n In Patients", "ar": "مرضاي\nالمنومين"}, "myInPatientTitle": {"en": "My Patients", "ar": "مرضاي المنومين"}, "inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"}, "inPatientAll": {"en": "All Patients", "ar": "جميع المرضى المنومين"}, diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index 29697dc1..b2242ff7 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -37,19 +37,21 @@ class _MyReferralInPatientScreenState extends State { children: [ Container( margin: EdgeInsets.only(top: 70), - child: PatientTypeRadioWidget( - (patientType) async { - setState(() { - this.patientType = patientType; - }); - GifLoaderDialogUtils.showMyDialog(context); - if (patientType == PatientType.IN_PATIENT) { - await model.getMyReferralPatientService(localBusy: true); - } else { - await model.getMyReferralOutPatientService(localBusy: true); - } - GifLoaderDialogUtils.hideDialog(context); - }, + child: Container( + child: PatientTypeRadioWidget( + (patientType) async { + setState(() { + this.patientType = patientType; + }); + GifLoaderDialogUtils.showMyDialog(context); + if (patientType == PatientType.IN_PATIENT) { + await model.getMyReferralPatientService(localBusy: true); + } else { + await model.getMyReferralOutPatientService(localBusy: true); + } + GifLoaderDialogUtils.hideDialog(context); + }, + ), ), ), model.myReferralPatients.isEmpty @@ -74,91 +76,93 @@ class _MyReferralInPatientScreenState extends State { : Expanded( child: SingleChildScrollView( child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ListView.builder( - itemCount: model.myReferralPatients.length, - scrollDirection: Axis.vertical, - physics: ScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, index) { - return InkWell( - onTap: () { - if (patientType == - PatientType.OUT_PATIENT) { - Navigator.push( - context, - FadePage( - page: MyReferralDetailScreen( - referralPatient: model - .myReferralPatients[index]), - ), - ); - } else { - Navigator.push( - context, - FadePage( - page: ReferralPatientDetailScreen( - model.myReferralPatients[index], - model), - ), - ); - } - }, - child: PatientReferralItemWidget( - referralStatus: - model.getReferralStatusNameByCode( - model.myReferralPatients[index] - .referralStatus, - context), - referralStatusCode: model - .myReferralPatients[index] - .referralStatus, - patientName: model - .myReferralPatients[index] - .patientName, - patientGender: model - .myReferralPatients[index].gender, - referredDate: AppDateUtils - .getDayMonthYearDateFormatted(model - .myReferralPatients[index] - .referralDate), - referredTime: AppDateUtils.getTimeHHMMA( - model.myReferralPatients[index] - .referralDate), - patientID: - "${model.myReferralPatients[index].patientID}", - isSameBranch: false, - isReferral: true, - isReferralClinic: true, - referralClinic: - "${model.myReferralPatients[index].referringClinicDescription}", - remark: model.myReferralPatients[index] - .referringDoctorRemarks, - nationality: model - .myReferralPatients[index] - .nationalityName, - nationalityFlag: model - .myReferralPatients[index] - .nationalityFlagURL, - doctorAvatar: model - .myReferralPatients[index] - .doctorImageURL, - referralDoctorName: model - .myReferralPatients[index] - .referringDoctorName, - clinicDescription: model - .myReferralPatients[index] - .referringClinicDescription, - infoIcon: Icon( - FontAwesomeIcons.arrowRight, - size: 25, - color: Colors.black), - ), - ); - }) - ], + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListView.builder( + itemCount: model.myReferralPatients.length, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + if (patientType == + PatientType.OUT_PATIENT) { + Navigator.push( + context, + FadePage( + page: MyReferralDetailScreen( + referralPatient: model + .myReferralPatients[index]), + ), + ); + } else { + Navigator.push( + context, + FadePage( + page: ReferralPatientDetailScreen( + model.myReferralPatients[index], + model), + ), + ); + } + }, + child: PatientReferralItemWidget( + referralStatus: + model.getReferralStatusNameByCode( + model.myReferralPatients[index] + .referralStatus, + context), + referralStatusCode: model + .myReferralPatients[index] + .referralStatus, + patientName: model + .myReferralPatients[index] + .patientName, + patientGender: model + .myReferralPatients[index].gender, + referredDate: AppDateUtils + .getDayMonthYearDateFormatted(model + .myReferralPatients[index] + .referralDate), + referredTime: AppDateUtils.getTimeHHMMA( + model.myReferralPatients[index] + .referralDate), + patientID: + "${model.myReferralPatients[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic: + "${model.myReferralPatients[index].referringClinicDescription}", + remark: model.myReferralPatients[index] + .referringDoctorRemarks, + nationality: model + .myReferralPatients[index] + .nationalityName, + nationalityFlag: model + .myReferralPatients[index] + .nationalityFlagURL, + doctorAvatar: model + .myReferralPatients[index] + .doctorImageURL, + referralDoctorName: model + .myReferralPatients[index] + .referringDoctorName, + clinicDescription: model + .myReferralPatients[index] + .referringClinicDescription, + infoIcon: Icon( + FontAwesomeIcons.arrowRight, + size: 25, + color: Colors.black), + ), + ); + }) + ], + ), ), ), ), diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 34b5938c..9839d0ad 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -118,8 +119,9 @@ class MethodTypeCard extends StatelessWidget { AppText( label, fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* (SizeConfig.isHeightVeryShort?3:3.7), - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, ) ], ), diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index b28149b8..4a6e90cd 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -37,7 +37,9 @@ class GetActivityCard extends StatelessWidget { AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), + fontHeight: 1.4, + + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9.3), color: AppGlobal.appTextColor, textAlign: TextAlign.start, fontWeight: FontWeight.w600, diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 4fa6ac82..6b3d87d5 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -126,7 +126,7 @@ class GetOutPatientStack extends StatelessWidget { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textAlign: TextAlign.center, color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w500, letterSpacing: -0.3, ), AppText( diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index cfa086b5..0e077895 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -55,7 +55,7 @@ class PatientReferralItemWidget extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), + margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0), child: Column( children: [ Container( diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 31c4c903..a3c4492f 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -104,7 +104,6 @@ class PatientProfileButton extends StatelessWidget { color: color ?? AppGlobal.appTextColor, letterSpacing: -0.33, fontWeight: FontWeight.w600, - textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 1.30, ), @@ -113,6 +112,7 @@ class PatientProfileButton extends StatelessWidget { color: color ?? Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, + fontHeight: 1.4, fontSize: SizeConfig.textMultiplier * 1.30, ), if (isLoading) DrAppCircularProgressIndeicator()