add copy to patient cart

fixes_before_live
Elham Rababh 5 years ago
parent a5f3731b9a
commit c17f9fb91d

@ -35,7 +35,6 @@ class PatientCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
margin: EdgeInsets.all(6), margin: EdgeInsets.all(6),
@ -260,9 +259,9 @@ class PatientCard extends StatelessWidget {
patientInfo.fullName) patientInfo.fullName)
: (Helpers.capitalize( : (Helpers.capitalize(
patientInfo.firstName) + patientInfo.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(
patientInfo.lastName)), patientInfo.lastName)),
fontSize: 16, fontSize: 16,
color: Color(0xff2e303a), color: Color(0xff2e303a),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -270,7 +269,6 @@ class PatientCard extends StatelessWidget {
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
), ),
), ),
if (patientInfo.gender == 1) if (patientInfo.gender == 1)
Icon( Icon(
DoctorApp.male_2, DoctorApp.male_2,
@ -281,9 +279,10 @@ class PatientCard extends StatelessWidget {
DoctorApp.female_1, DoctorApp.female_1,
color: Colors.pink, color: Colors.pink,
), ),
if (isFromLiveCare)
if(isFromLiveCare) ShowTimer(
ShowTimer(patientInfo: patientInfo,), patientInfo: patientInfo,
),
]), ]),
), ),
Row( Row(
@ -351,129 +350,45 @@ class PatientCard extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( CustomRow(
child: RichText( label: TranslationBase.of(context).fileNumber,
text: new TextSpan( value: patientInfo.patientId.toString(),
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context)
.fileNumber,
style: TextStyle(
fontSize: 12,
fontFamily: 'Poppins')),
new TextSpan(
text: patientInfo.patientId.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 13)),
],
),
),
), ),
//if (isInpatient) //if (isInpatient)
Container(
child: RichText( CustomRow(
text: new TextSpan( label: TranslationBase.of(context).age + " : ",
style: new TextStyle( value:
fontSize: 2.0 * SizeConfig.textMultiplier, "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age +
" : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
],
),
),
), ),
if (isInpatient) if (isInpatient)
Container( CustomRow(
child: RichText( label: patientInfo.admissionDate == null
text: new TextSpan( ? ""
style: new TextStyle( : TranslationBase.of(context)
fontSize: .admissionDate +
2.0 * SizeConfig.textMultiplier, " : ",
color: Colors.black, value: patientInfo.admissionDate == null
fontFamily: 'Poppins', ? ""
), : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
children: <TextSpan>[ ),
new TextSpan(
text: patientInfo.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate +
" : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text: patientInfo.admissionDate == null
? ""
: "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
]))),
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
Container( CustomRow(
child: RichText( label: TranslationBase.of(context).numOfDays +
text: new TextSpan( " : ",
style: new TextStyle( value:
fontSize: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
2.0 * SizeConfig.textMultiplier, ),
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context)
.numOfDays +
" : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
]))),
if (isFromLiveCare) if (isFromLiveCare)
Column( Column(
children: [ children: [
Container(
child: RichText( CustomRow(label: TranslationBase.of(context)
text: new TextSpan( .clinic +
style: new TextStyle( " : ",value: patientInfo.clinicName,),
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(context).clinic +
" : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text:
patientInfo.clinicName,
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
],
),
),
),
], ],
), ),
])) ]))
@ -522,14 +437,47 @@ class PatientCard extends StatelessWidget {
height: 25, height: 25,
width: 35, width: 35,
)), )),
]) ])
: SizedBox() : SizedBox()
], ],
), ),
onTap: onTap, onTap: onTap,
)), )),
)); ));
} }
}
class CustomRow extends StatelessWidget {
const CustomRow({
Key key,
this.label,
this.value,
}) : super(key: key);
final String label;
final String value;
@override
Widget build(BuildContext context) {
return Row(
children: [
AppText(
label,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.8,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
value,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
);
}
} }

@ -103,6 +103,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
isCopyable: true,
), ),
), ),
gender == 1 gender == 1
@ -347,112 +348,46 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
3.5, 3.5,
isCopyable: true,
), ),
if (orderNo != null && !isPrescriptions) if (orderNo != null && !isPrescriptions)
Row( HeaderRow(
children: <Widget>[ label: 'Order No: ',
AppText( value: orderNo ?? '',
'Order No: ',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(orderNo ?? '', fontSize: 12)
],
), ),
if (invoiceNO != null && !isPrescriptions) if (invoiceNO != null && !isPrescriptions)
Row( HeaderRow(
children: <Widget>[ label: 'Invoice: ',
AppText( value: invoiceNO ?? "",
'Invoice: ',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(invoiceNO ?? "", fontSize: 12)
],
), ),
if (branch != null) if (branch != null)
Row( HeaderRow(
children: [ label: 'Branch: ',
AppText( value: branch ?? '',
'Branch: ',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(branch ?? '', fontSize: 12)
],
), ),
if (clinic != null) if (clinic != null)
Row( HeaderRow(
children: [ label: 'Clinic: ',
AppText( value: clinic ?? '',
'Clinic: ',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(clinic ?? '', fontSize: 12)
],
), ),
if (isMedicalFile && episode != null) if (isMedicalFile && episode != null)
Row( HeaderRow(
children: [ label: 'Episode: ',
AppText( value: episode ?? '',
'Episode: ',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(episode ?? '', fontSize: 12)
],
), ),
if (isMedicalFile && visitDate != null) if (isMedicalFile && visitDate != null)
Row( HeaderRow(
children: [ label: 'Visit Date: ',
AppText( value: visitDate ?? '',
'Visit Date: ',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(visitDate ?? '', fontSize: 12)
],
), ),
if (!isMedicalFile) if (!isMedicalFile)
Row( HeaderRow(
children: <Widget>[ label: !isPrescriptions
AppText( ? 'Result Date:'
!isPrescriptions : 'Prescriptions Date ',
? 'Result Date:' value:
: 'Prescriptions Date ',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
fontSize: SizeConfig ),
.getTextMultiplierBasedOnWidth() *
3.5,
)
],
)
]), ]),
), ),
), ),
@ -497,6 +432,7 @@ class HeaderRow extends StatelessWidget {
children: [ children: [
AppText( AppText(
label, label,
isCopyable: true,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

Loading…
Cancel
Save