fix referral card

merge-requests/377/head
Elham Rababah 5 years ago
parent 49201d0f3d
commit 4f558dc41d

@ -328,7 +328,7 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': 'لا وصفة طبية مدرجة' 'ar': 'لا وصفة طبية مدرجة'
}, },
'referTo': {'en': "Refer To", 'ar': 'محال إلى'}, 'referTo': {'en': "Refer To", 'ar': 'محال إلى'},
'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, 'referredFrom': {'en': "From : ", 'ar': ' : من'},
'branch': {'en': "Branch", 'ar': 'الفرع'}, 'branch': {'en': "Branch", 'ar': 'الفرع'},
'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'}, 'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'},
'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'}, 'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'},

@ -23,6 +23,7 @@ class MyReferralPatientScreen extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
body: model.pendingReferral == null || model.pendingReferral.length == 0 body: model.pendingReferral == null || model.pendingReferral.length == 0
? Center( ? Center(
@ -33,33 +34,35 @@ class MyReferralPatientScreen extends StatelessWidget {
) )
: SingleChildScrollView( : SingleChildScrollView(
child: Container( child: Container(
// color: Colors.white,
height: MediaQuery.of(context).size.height,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 100), SizedBox(height: 100),
ProfileWelcomeWidget( // ProfileWelcomeWidget(
AppText( // AppText(
authProvider.selectedClinicName != null // authProvider.selectedClinicName != null
? authProvider.selectedClinicName // ? authProvider.selectedClinicName
: authProvider.doctorProfile.clinicDescription, // : authProvider.doctorProfile.clinicDescription,
fontSize: SizeConfig.textMultiplier * 1.7, // fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white, // color: Colors.white,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
), // ),
height: 100, // height: 100,
), // ),
SizedBox( // SizedBox(
height: 16, // height: 16,
), // ),
Padding( // Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), // padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: AppText( // child: AppText(
TranslationBase.of(context).myReferralPatient, // TranslationBase.of(context).myReferralPatient,
color: Colors.black, // color: Colors.black,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
fontSize: 16, // fontSize: 16,
), // ),
), // ),
...List.generate( ...List.generate(
model.pendingReferral.length, model.pendingReferral.length,
(index) => InkWell( (index) => InkWell(
@ -71,6 +74,7 @@ class MyReferralPatientScreen extends StatelessWidget {
}, },
child: PatientReferralItemWidget( child: PatientReferralItemWidget(
"${model.pendingReferral[index].patientID}", "${model.pendingReferral[index].patientID}",
patientInfo:model.pendingReferral[index] ,
patientName: patientName:
model.pendingReferral[index].patientName, model.pendingReferral[index].patientName,
referralStatus: null, referralStatus: null,

@ -37,6 +37,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen>
appBarTitle: TranslationBase.of(context).patientsreferral, appBarTitle: TranslationBase.of(context).patientsreferral,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
// backgroundColor: Colors.white,
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0), preferredSize: Size.fromHeight(65.0),
child: Center( child: Center(

@ -1,6 +1,11 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class PatientReferralItemWidget extends StatelessWidget { class PatientReferralItemWidget extends StatelessWidget {
final String patientName; final String patientName;
@ -14,6 +19,7 @@ class PatientReferralItemWidget extends StatelessWidget {
final String referredOn; final String referredOn;
final String answerFromTarget; final String answerFromTarget;
final Widget infoIcon; final Widget infoIcon;
final PendingReferral patientInfo;
PatientReferralItemWidget( PatientReferralItemWidget(
this.patientID, { this.patientID, {
@ -27,6 +33,7 @@ class PatientReferralItemWidget extends StatelessWidget {
this.referredOn, this.referredOn,
this.answerFromTarget, this.answerFromTarget,
this.infoIcon, this.infoIcon,
this.patientInfo,
}); });
@override @override
@ -35,222 +42,389 @@ class PatientReferralItemWidget extends StatelessWidget {
margin: EdgeInsets.all(16.0), margin: EdgeInsets.all(16.0),
child: Column( child: Column(
children: [ children: [
Row( //TODO should be removed by mousa
children: [ // Row(
Expanded( // children: [
child: Column( // Expanded(
crossAxisAlignment: CrossAxisAlignment.start, // child: Column(
children: <Widget>[ // crossAxisAlignment: CrossAxisAlignment.start,
if (referralStatus != null) // children: <Widget>[
// if (referralStatus != null)
// Row(
// children: [
// AppText(
// TranslationBase.of(context).referralStatus,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// Container(
// color: Color(0xFF4BA821),
// padding: EdgeInsets.all(4),
// child: AppText(
// referralStatus
// /*referralStatus == "46"
// ? TranslationBase.of(context).approved
// : TranslationBase.of(context).rejected*/
// ,
// color: Colors.white,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// isReferredTo
// ? "${TranslationBase.of(context).referTo}: "
// : "${TranslationBase.of(context).referredFrom}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// isSameBranch
// ? TranslationBase.of(context).sameBranch
// : TranslationBase.of(context).otherBranch,
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// AppText(
// "${TranslationBase.of(context).referralDoctor} : ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// Expanded(
// child: AppText(
// referralDoctorName != null
// ? "${TranslationBase.of(context).dr} $referralDoctorName"
// : "-",
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// if (clinicDescription != null)
// Row(
// children: [
// AppText(
// "${TranslationBase.of(context).clinic}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// clinicDescription,
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// "${TranslationBase.of(context).patientID}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// patientID ?? '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// "${TranslationBase.of(context).patientName}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// patientName ?? '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// AppText(
// TranslationBase.of(context).referralRemark,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// Expanded(
// child: AppText(
// remark,
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// TranslationBase.of(context).referredOn,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// referredOn ?? '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// if (answerFromTarget != null)
// SizedBox(
// height: 8,
// ),
// if (answerFromTarget != null)
// Row(
// children: [
// AppText(
// TranslationBase.of(context).referralResponse,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// answerFromTarget != "" ? answerFromTarget : '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 16,
// ),
// ],
// ),
// ),
// if (infoIcon != null) infoIcon,
// ],
// ),
// const Divider(
// color: Color(0xffCCCCCC),
// height: 1,
// thickness: 1,
// indent: 0,
// endIndent: 0,
// ),
SizedBox(
height: 8,
),
Container(
child: CardWithBgWidget(
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( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( RichText(
TranslationBase.of(context).referralStatus, text: new TextSpan(
color: Colors.grey, style: new TextStyle(
fontWeight: FontWeight.bold, fontSize: 2.0 * SizeConfig.textMultiplier,
fontSize: 12, color: Colors.black),
), children: <TextSpan>[
Container( new TextSpan(
color: Color(0xFF4BA821), text: patientInfo.referralStatus,
padding: EdgeInsets.all(4), style: TextStyle(
child: AppText( color: patientInfo.referralStatus =='Pending'
referralStatus ? Colors.orange[400]
/*referralStatus == "46" : Colors.red[800],
? TranslationBase.of(context).approved fontWeight: FontWeight.w700,
: TranslationBase.of(context).rejected*/ fontFamily: 'Poppins',
, fontSize: 18)),
color: Colors.white, ],
fontWeight: FontWeight.bold,
fontSize: 12,
), ),
), ),
//TODO :ask backend to return in the standerformate
AppText(
referredOn,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
], ],
), ),
SizedBox( AppText(
height: 8, patientInfo.patientName,
), fontSize: SizeConfig.textMultiplier * 2,
Row( fontWeight: FontWeight.bold,
children: [ backGroundcolor: Colors.white,
AppText( fontFamily: 'Poppins',
isReferredTo ),
? "${TranslationBase.of(context).referTo}: " SizedBox(
: "${TranslationBase.of(context).referredFrom}: ", width: 10,
color: Colors.grey, ),
fontWeight: FontWeight.bold, RichText(
fontSize: 12, text: new TextSpan(
), style: new TextStyle(
AppText( fontSize: 2.0 * SizeConfig.textMultiplier,
isSameBranch color: Colors.black),
? TranslationBase.of(context).sameBranch children: <TextSpan>[
: TranslationBase.of(context).otherBranch, new TextSpan(
color: Colors.black, text: TranslationBase
fontWeight: FontWeight.bold, .of(context)
fontSize: 12, .fileNumber,
), style: TextStyle(
], fontSize: 14,
), fontFamily: 'Poppins')),
SizedBox( new TextSpan(
height: 8, text: patientInfo.patientID.toString(),
), style: TextStyle(
Row( fontWeight: FontWeight.w700,
crossAxisAlignment: CrossAxisAlignment.start, fontFamily: 'Poppins',
children: [ fontSize: 15)),
AppText( ],
"${TranslationBase.of(context).referralDoctor} : ",
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
), ),
Expanded( ),
child: AppText( Container(
referralDoctorName != null child: RichText(
? "${TranslationBase.of(context).dr} $referralDoctorName" text: new TextSpan(
: "-", style: new TextStyle(
color: Colors.black, fontSize: 2.0 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, color: Colors.black),
fontSize: 12, children: <TextSpan>[
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)),
],
), ),
), ),
],
),
SizedBox(
height: 8,
),
if (clinicDescription != null)
Row(
children: [
AppText(
"${TranslationBase.of(context).clinic}: ",
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
clinicDescription,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
],
), ),
SizedBox( Container(
height: 8, child: RichText(
), text: new TextSpan(
Row( style: new TextStyle(
children: [ fontSize: 2.0 * SizeConfig.textMultiplier,
AppText( color: Colors.black),
"${TranslationBase.of(context).patientID}: ", children: <TextSpan>[
color: Colors.grey, new TextSpan(
fontWeight: FontWeight.bold, text: TranslationBase
fontSize: 12, .of(context)
), .remarks + " : ",
AppText( style: TextStyle(
patientID ?? '-', fontSize: 14,
color: Colors.black, fontFamily: 'Poppins')),
fontWeight: FontWeight.bold, new TextSpan(
fontSize: 12, text: patientInfo.remarksFromSource,
), style: TextStyle(
], fontWeight: FontWeight.w700,
), fontFamily: 'Poppins',
SizedBox( fontSize: 15)),
height: 8, ],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).patientName}: ",
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
patientName ?? '-',
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
],
),
SizedBox(
height: 8,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).referralRemark,
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
Expanded(
child: AppText(
remark,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
), ),
), ),
],
),
SizedBox(
height: 8,
),
Row(
children: [
AppText(
TranslationBase.of(context).referredOn,
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
referredOn ?? '-',
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
],
),
if (answerFromTarget != null)
SizedBox(
height: 8,
), ),
if (answerFromTarget != null) SizedBox(height: 20,),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText(
TranslationBase.of(context).referralResponse, Column(children: [
color: Colors.grey, RichText(
fontWeight: FontWeight.bold, text: new TextSpan(
fontSize: 12, style: new TextStyle(
), fontSize: 2.0 * SizeConfig.textMultiplier,
AppText( color: Colors.black),
answerFromTarget != "" ? answerFromTarget : '-', children: <TextSpan>[
color: Colors.black, new TextSpan(
fontWeight: FontWeight.bold, text: TranslationBase
fontSize: 12, .of(context)
), .referralDoctor + " : ",
], style: TextStyle(
), fontSize: 14,
SizedBox( fontFamily: 'Poppins')),
height: 16, new TextSpan(
), text: referralDoctorName,
], style: TextStyle(
), fontWeight: FontWeight.w700,
), fontFamily: 'Poppins',
if (infoIcon != null) infoIcon, fontSize: 15)),
], ],
), ),
const Divider( )
color: Color(0xffCCCCCC), ],),
height: 1, Icon(FontAwesomeIcons.arrowRight, size: 25,color:Colors.black)
thickness: 1, ],)
indent: 0, ],
endIndent: 0, ),
), // onTap: onTap,
SizedBox( )) ,),
height: 8,
), ),
], ],
), ),

@ -13,8 +13,11 @@ import 'package:provider/provider.dart';
class CardWithBgWidget extends StatelessWidget { class CardWithBgWidget extends StatelessWidget {
final Widget widget; final Widget widget;
final Color bgColor;
final bool hasBorder;
CardWithBgWidget({@required this.widget}); CardWithBgWidget(
{@required this.widget, this.bgColor, this.hasBorder = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -26,7 +29,9 @@ class CardWithBgWidget extends StatelessWidget {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(color: HexColor('#707070'), width: 2.0), border: Border.all(
color: hasBorder ? HexColor('#707070') : Colors.transparent,
width: hasBorder ? 2.0 : 0),
), ),
child: Material( child: Material(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -34,23 +39,33 @@ class CardWithBgWidget extends StatelessWidget {
children: [ children: [
if (projectProvider.isArabic) if (projectProvider.isArabic)
Positioned( Positioned(
child: Container( child: Container(
decoration: BoxDecoration(
color: bgColor ?? HexColor('#58434F'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),),),
width: 10, width: 10,
color: HexColor('#58434F'),
), ),
bottom: 0, bottom: 1,
top: 0, top: 1,
right: 0, right: 1,
) )
else else
Positioned( Positioned(
child: Container( child: Container(
decoration: BoxDecoration(
color: bgColor ?? HexColor('#58434F'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),),),
width: 10, width: 10,
color: HexColor('#58434F'),
), ),
bottom: 0, bottom: 1,
top: 0, top: 1,
left: 0, left: 1,
), ),
Container( Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),

Loading…
Cancel
Save