|
|
|
@ -11,33 +11,38 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
final String referralStatus;
|
|
|
|
|
final String patientName;
|
|
|
|
|
final int patientGender;
|
|
|
|
|
final String referredDate;
|
|
|
|
|
final String referredTime;
|
|
|
|
|
final String patientID;
|
|
|
|
|
final String referralStatus;
|
|
|
|
|
final isReferredTo;
|
|
|
|
|
final isSameBranch;
|
|
|
|
|
final bool isReferral;
|
|
|
|
|
final String remark;
|
|
|
|
|
final String nationality;
|
|
|
|
|
final String nationalityFlag;
|
|
|
|
|
final String doctorAvatar;
|
|
|
|
|
final String referralDoctorName;
|
|
|
|
|
final String clinicDescription;
|
|
|
|
|
final String remark;
|
|
|
|
|
final String referredOn;
|
|
|
|
|
final String answerFromTarget;
|
|
|
|
|
final Widget infoIcon;
|
|
|
|
|
final PendingReferral patientInfo;
|
|
|
|
|
|
|
|
|
|
PatientReferralItemWidget(
|
|
|
|
|
this.patientID, {
|
|
|
|
|
this.patientName,
|
|
|
|
|
this.referralStatus,
|
|
|
|
|
this.isReferredTo = false,
|
|
|
|
|
this.isSameBranch,
|
|
|
|
|
this.referralDoctorName,
|
|
|
|
|
this.clinicDescription,
|
|
|
|
|
this.remark,
|
|
|
|
|
this.referredOn,
|
|
|
|
|
this.answerFromTarget,
|
|
|
|
|
this.infoIcon,
|
|
|
|
|
this.patientInfo,
|
|
|
|
|
});
|
|
|
|
|
{this.referralStatus,
|
|
|
|
|
this.patientName,
|
|
|
|
|
this.patientGender,
|
|
|
|
|
this.referredDate,
|
|
|
|
|
this.referredTime,
|
|
|
|
|
this.patientID,
|
|
|
|
|
this.isSameBranch,
|
|
|
|
|
this.isReferral,
|
|
|
|
|
this.remark,
|
|
|
|
|
this.nationality,
|
|
|
|
|
this.nationalityFlag,
|
|
|
|
|
this.doctorAvatar,
|
|
|
|
|
this.referralDoctorName,
|
|
|
|
|
this.clinicDescription,
|
|
|
|
|
this.infoIcon});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@ -47,224 +52,6 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
// TODO should be removed by mousa
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// 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: referralStatus != null
|
|
|
|
@ -296,7 +83,7 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
: Colors.grey[500],
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
referredOn,
|
|
|
|
|
referredDate,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 2.0 * SizeConfig.textMultiplier,
|
|
|
|
@ -309,7 +96,7 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
patientInfo.patientName,
|
|
|
|
|
patientName,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.2,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
backGroundcolor: Colors.white,
|
|
|
|
@ -320,7 +107,7 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 4,
|
|
|
|
|
),
|
|
|
|
|
/*patient.gender*/ 1 == 1
|
|
|
|
|
patientGender == 1
|
|
|
|
|
? Icon(
|
|
|
|
|
DoctorApp.male_2,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
@ -333,7 +120,7 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
width: 4,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
referredOn,
|
|
|
|
|
referredTime,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 1.8 * SizeConfig.textMultiplier,
|
|
|
|
@ -359,7 +146,7 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
color: Color(0XFF575757),
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.patientID.toString(),
|
|
|
|
|
patientID,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 1.8 * SizeConfig.textMultiplier,
|
|
|
|
@ -395,36 +182,25 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
/*patient.nationalityName ??
|
|
|
|
|
patient.nationality*/
|
|
|
|
|
"Saudi",
|
|
|
|
|
nationality != null ? nationality : "",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontSize: 1.4 * SizeConfig.textMultiplier,
|
|
|
|
|
),
|
|
|
|
|
/* patient.nationality != null
|
|
|
|
|
nationalityFlag != null
|
|
|
|
|
? ClipRRect(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius
|
|
|
|
|
.circular(
|
|
|
|
|
20.0),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
patient
|
|
|
|
|
.nationalityFlagURL,
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 30,
|
|
|
|
|
errorBuilder:
|
|
|
|
|
(BuildContext
|
|
|
|
|
context,
|
|
|
|
|
Object
|
|
|
|
|
exception,
|
|
|
|
|
StackTrace
|
|
|
|
|
stackTrace) {
|
|
|
|
|
return Text(
|
|
|
|
|
'No Image');
|
|
|
|
|
},
|
|
|
|
|
))*/
|
|
|
|
|
/*:*/ SizedBox()
|
|
|
|
|
borderRadius: BorderRadius.circular(20.0),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
nationalityFlag,
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 30,
|
|
|
|
|
errorBuilder: (BuildContext context,
|
|
|
|
|
Object exception,
|
|
|
|
|
StackTrace stackTrace) {
|
|
|
|
|
return Text('No Image');
|
|
|
|
|
},
|
|
|
|
|
))
|
|
|
|
|
: SizedBox()
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
@ -442,7 +218,7 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
patientInfo.remarksFromSource,
|
|
|
|
|
remark,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 1.8 * SizeConfig.textMultiplier,
|
|
|
|
@ -457,7 +233,9 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 10, right: 0),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
infoIcon != null ? 'assets/images/patient/ic_ref_arrow_up.png' : 'assets/images/patient/ic_ref_arrow_left.png',
|
|
|
|
|
isReferral
|
|
|
|
|
? 'assets/images/patient/ic_ref_arrow_up.png'
|
|
|
|
|
: 'assets/images/patient/ic_ref_arrow_left.png',
|
|
|
|
|
height: 50,
|
|
|
|
|
width: 30,
|
|
|
|
|
),
|
|
|
|
@ -469,9 +247,10 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
'assets/images/female_avatar.png',
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
child: CircleAvatar(
|
|
|
|
|
radius: 25.0,
|
|
|
|
|
backgroundImage: NetworkImage(doctorAvatar),
|
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -482,29 +261,13 @@ class PatientReferralItemWidget extends StatelessWidget {
|
|
|
|
|
left: 10, top: 25, right: 10, bottom: 0),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
RichText(
|
|
|
|
|
text: TextSpan(
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize:
|
|
|
|
|
2.0 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
children: <TextSpan>[
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: TranslationBase.of(context)
|
|
|
|
|
.referralDoctor +
|
|
|
|
|
" : ",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontFamily: 'Poppins')),
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: referralDoctorName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 15)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
AppText(
|
|
|
|
|
referralDoctorName,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0XFF2E303A),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|