From 27ff179750756448c80a24d7d25d7dd9a5a1db65 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 28 Mar 2021 11:12:42 +0300 Subject: [PATCH] working on referral screen bugs --- .../referral/my-referral-detail-screen.dart | 3 +- .../referral/my-referral-patient-screen.dart | 34 ++++--------------- .../referral/patient_referral_screen.dart | 3 +- .../referral/referred-patient-screen.dart | 1 + .../patient-referral-item-widget.dart | 19 +++++------ 5 files changed, 20 insertions(+), 40 deletions(-) diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 134f3c2a..d6d9e8b6 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -126,7 +126,7 @@ class MyReferralDetailScreen extends StatelessWidget { PatientReferralItemWidget( "${pendingReferral.patientID}", patientName: pendingReferral.patientName, - referralStatus: null, + referralStatus: pendingReferral.referralStatus, isReferredTo: false, isSameBranch: pendingReferral.isReferralDoctorSameBranch, @@ -135,6 +135,7 @@ class MyReferralDetailScreen extends StatelessWidget { clinicDescription: null, remark: pendingReferral.remarksFromSource, referredOn: pendingReferral.referredOn, + patientInfo: pendingReferral, ), SizedBox( child: ProfileMedicalInfoWidgetSearch( diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index f54ac5e6..3cab440c 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -23,7 +23,6 @@ class MyReferralPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( @@ -34,35 +33,13 @@ class MyReferralPatientScreen extends StatelessWidget { ) : SingleChildScrollView( child: Container( + margin: EdgeInsets.only(top: 50), // color: Colors.white, - height: MediaQuery.of(context).size.height, + // height: MediaQuery.of(context).size.height, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: 100), - // ProfileWelcomeWidget( - // AppText( - // authProvider.selectedClinicName != null - // ? authProvider.selectedClinicName - // : authProvider.doctorProfile.clinicDescription, - // fontSize: SizeConfig.textMultiplier * 1.7, - // color: Colors.white, - // textAlign: TextAlign.center, - // ), - // height: 100, - // ), - // SizedBox( - // height: 16, - // ), - // Padding( - // padding: const EdgeInsets.symmetric(horizontal: 16.0), - // child: AppText( - // TranslationBase.of(context).myReferralPatient, - // color: Colors.black, - // fontWeight: FontWeight.bold, - // fontSize: 16, - // ), - // ), + // SizedBox(height: 50), ...List.generate( model.pendingReferral.length, (index) => InkWell( @@ -74,10 +51,11 @@ class MyReferralPatientScreen extends StatelessWidget { }, child: PatientReferralItemWidget( "${model.pendingReferral[index].patientID}", - patientInfo:model.pendingReferral[index] , + patientInfo: model.pendingReferral[index], patientName: model.pendingReferral[index].patientName, - referralStatus: null, + referralStatus: + model.pendingReferral[index].referralStatus, isReferredTo: false, isSameBranch: model.pendingReferral[index] .isReferralDoctorSameBranch, diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 2906e196..adea0247 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -92,7 +92,8 @@ class _PatientReferralScreen extends State controller: _tabController, children: [ MyReferralPatientScreen(), - MyReferredPatient(), + ReferredPatientScreen(), + // MyReferredPatient(), ], ), ) diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 323a9a9b..d6a81603 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -15,6 +15,7 @@ class ReferredPatientScreen extends StatelessWidget { onModelReady: (model) => model.getMyReferredPatient(), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).referredPatient, body: model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index a218e864..d5c1d035 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -39,7 +39,7 @@ class PatientReferralItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.all(16.0), + margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), child: Column( children: [ // TODO should be removed by mousa @@ -257,14 +257,14 @@ class PatientReferralItemWidget extends StatelessWidget { // indent: 0, // endIndent: 0, // ), - SizedBox( - height: 8, - ), + // SizedBox( + // height: 8, + // ), Container( child: CardWithBgWidget( - bgColor: patientInfo.referralStatus == 'Pending' + bgColor: referralStatus != null ? referralStatus == 'Pending' ? Colors.orange[400] - : Colors.red[800], + : Colors.red[800] : Colors.grey[500], hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -283,12 +283,11 @@ class PatientReferralItemWidget extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: patientInfo.referralStatus, + text: referralStatus != null ? referralStatus : "", style: TextStyle( - color: patientInfo.referralStatus == - 'Pending' + color: referralStatus != null ? referralStatus == 'Pending' ? Colors.orange[400] - : Colors.red[800], + : Colors.red[800] : Colors.grey[500], fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 18)),