From ed104a4562ac8f97437674f644fe958c2b537809 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 28 Mar 2021 10:29:07 +0300 Subject: [PATCH] working on referral card --- .../patient-referral-item-widget.dart | 252 +++++++++--------- 1 file changed, 121 insertions(+), 131 deletions(-) diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 1f45485f..a218e864 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -42,7 +42,7 @@ class PatientReferralItemWidget extends StatelessWidget { margin: EdgeInsets.all(16.0), child: Column( children: [ - //TODO should be removed by mousa + // TODO should be removed by mousa // Row( // children: [ // Expanded( @@ -262,73 +262,91 @@ class PatientReferralItemWidget extends StatelessWidget { ), Container( child: CardWithBgWidget( - bgColor: patientInfo.referralStatus =='Pending' + bgColor: patientInfo.referralStatus == 'Pending' ? Colors.orange[400] : Colors.red[800], hasBorder: false, - widget:Container( - // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), - child: InkWell( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: patientInfo.referralStatus, - style: TextStyle( - color: patientInfo.referralStatus =='Pending' - ? Colors.orange[400] - : Colors.red[800], - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 18)), - ], - ), + widget: Container( + // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: patientInfo.referralStatus, + style: TextStyle( + color: patientInfo.referralStatus == + 'Pending' + ? Colors.orange[400] + : Colors.red[800], + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 18)), + ], ), - //TODO :ask backend to return in the standerformate - AppText( - referredOn, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) + ), + //TODO :ask backend to return in the standerformate + AppText( + referredOn, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + ), + AppText( + patientInfo.patientName, + fontSize: SizeConfig.textMultiplier * 2, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + SizedBox( + width: 10, + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), ], ), - AppText( - patientInfo.patientName, - fontSize: SizeConfig.textMultiplier * 2, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', - ), - SizedBox( - width: 10, - ), - RichText( + ), + Container( + child: RichText( text: new TextSpan( style: new TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: TranslationBase - .of(context) - .fileNumber, + text: TranslationBase.of(context).referredFrom, style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), + fontSize: 14, fontFamily: 'Poppins')), new TextSpan( - text: patientInfo.patientID.toString(), + text: isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch, style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -336,95 +354,67 @@ class PatientReferralItemWidget extends StatelessWidget { ], ), ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase - .of(context) - .referredFrom, - style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: isSameBranch - ? TranslationBase - .of(context) - .sameBranch - : TranslationBase - .of(context) - .otherBranch, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of(context).remarks + " : ", + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.remarksFromSource, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( + ), + SizedBox( + height: 20, + ), + Column( + children: [ + RichText( + text: TextSpan( + style: TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ - new TextSpan( - text: TranslationBase - .of(context) - .remarks + " : ", + TextSpan( + text: TranslationBase.of(context) + .referralDoctor + + " : ", style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: patientInfo.remarksFromSource, + fontSize: 14, fontFamily: 'Poppins')), + TextSpan( + text: referralDoctorName, style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 15)), ], ), - ), - ), - SizedBox(height: 20,), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Column(children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase - .of(context) - .referralDoctor + " : ", - style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: referralDoctorName, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), - ) - ],), - Icon(FontAwesomeIcons.arrowRight, size: 25,color:Colors.black) - ],) - ], - ), - // onTap: onTap, - )) ,), + ) + ], + ), + Container( + width: double.infinity, + alignment: Alignment.centerRight, + child: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black)) + ], + ), + // onTap: onTap, + )), + ), ), ], ),