|
|
|
|
@ -12,7 +12,6 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import '../../../util/extenstions.dart';
|
|
|
|
|
|
|
|
|
|
@ -46,17 +45,20 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
String nationalityName = patientInfo.nationalityName != null
|
|
|
|
|
? patientInfo.nationalityName.trim()
|
|
|
|
|
: patientInfo.nationality != null
|
|
|
|
|
? patientInfo.nationality.trim()
|
|
|
|
|
: patientInfo.nationalityId !=
|
|
|
|
|
null
|
|
|
|
|
? patientInfo.nationalityId
|
|
|
|
|
: "";
|
|
|
|
|
? patientInfo.nationality.trim()
|
|
|
|
|
: patientInfo.nationalityId != null
|
|
|
|
|
? patientInfo.nationalityId
|
|
|
|
|
: "";
|
|
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
width: SizeConfig.screenWidth * 0.9,
|
|
|
|
|
margin: EdgeInsets.all(6),
|
|
|
|
|
padding: EdgeInsets.only(left: projectViewModel.isArabic?5:0, right: projectViewModel.isArabic?0:5, bottom: 0, top: 0),
|
|
|
|
|
decoration:Helpers.getCardBoxDecoration(),
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: projectViewModel.isArabic ? 5 : 0,
|
|
|
|
|
right: projectViewModel.isArabic ? 0 : 5,
|
|
|
|
|
bottom: 0,
|
|
|
|
|
top: 0),
|
|
|
|
|
decoration: Helpers.getCardBoxDecoration(),
|
|
|
|
|
child: CardWithBgWidget(
|
|
|
|
|
padding: 0,
|
|
|
|
|
marginLeft: (!isMyPatient && isInpatient) ? 0 : 10,
|
|
|
|
|
@ -96,8 +98,11 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
patientInfo.patientStatusType == 43
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
PatientStatus(label:TranslationBase.of(context)
|
|
|
|
|
.arrivedP,color:AppGlobal.appGreenColor,),
|
|
|
|
|
PatientStatus(
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
.arrivedP,
|
|
|
|
|
color: AppGlobal.appGreenColor,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
@ -111,18 +116,25 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
PatientStatus(label:patientInfo.status == 2
|
|
|
|
|
? 'Confirmed'
|
|
|
|
|
: 'Booked',color: patientInfo.status == 2
|
|
|
|
|
? AppGlobal.appGreenColor
|
|
|
|
|
: Colors.grey,),
|
|
|
|
|
PatientStatus(
|
|
|
|
|
label: patientInfo.status == 2
|
|
|
|
|
? 'Confirmed'
|
|
|
|
|
: 'Booked',
|
|
|
|
|
color: patientInfo.status == 2
|
|
|
|
|
? AppGlobal.appGreenColor
|
|
|
|
|
: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: patientInfo.patientStatusType == 42
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
PatientStatus(label:TranslationBase.of(context)
|
|
|
|
|
.notArrived,color:Colors.red[800],),
|
|
|
|
|
PatientStatus(
|
|
|
|
|
label:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
@ -136,10 +148,14 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
PatientStatus(label:patientInfo.status == 2 ? 'Confirmed'
|
|
|
|
|
: 'Booked',color:patientInfo.status == 2
|
|
|
|
|
? AppGlobal.appGreenColor
|
|
|
|
|
: Colors.grey,)
|
|
|
|
|
PatientStatus(
|
|
|
|
|
label: patientInfo.status == 2
|
|
|
|
|
? 'Confirmed'
|
|
|
|
|
: 'Booked',
|
|
|
|
|
color: patientInfo.status == 2
|
|
|
|
|
? AppGlobal.appGreenColor
|
|
|
|
|
: Colors.grey,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: !isFromSearch &&
|
|
|
|
|
@ -148,8 +164,12 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
null
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
PatientStatus(label:TranslationBase.of(context)
|
|
|
|
|
.notArrived,color:Colors.red[800],),
|
|
|
|
|
PatientStatus(
|
|
|
|
|
label: TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
@ -163,13 +183,17 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
PatientStatus(label:patientInfo.status == 2
|
|
|
|
|
? 'Booked'
|
|
|
|
|
: 'Confirmed',color:
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? Colors.grey
|
|
|
|
|
: AppGlobal.appGreenColor,)
|
|
|
|
|
PatientStatus(
|
|
|
|
|
label:
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? 'Booked'
|
|
|
|
|
: 'Confirmed',
|
|
|
|
|
color:
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? Colors.grey
|
|
|
|
|
: AppGlobal
|
|
|
|
|
.appGreenColor,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
@ -182,29 +206,55 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
)
|
|
|
|
|
: patientInfo.arrivedOn != null
|
|
|
|
|
? AppText(
|
|
|
|
|
AppDateUtils.getDayMonthYearDate(
|
|
|
|
|
AppDateUtils
|
|
|
|
|
.convertStringToDate(
|
|
|
|
|
patientInfo.arrivedOn,
|
|
|
|
|
)) +
|
|
|
|
|
" " +
|
|
|
|
|
? Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
AppDateUtils
|
|
|
|
|
.getDayMonthYearDateFormatted(
|
|
|
|
|
AppDateUtils
|
|
|
|
|
.convertStringToDate(
|
|
|
|
|
patientInfo.arrivedOn,
|
|
|
|
|
),
|
|
|
|
|
isMonthShort: true,
|
|
|
|
|
),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"${AppDateUtils.getStartTime(patientInfo.startTime)}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: (patientInfo.appointmentDate !=
|
|
|
|
|
null &&
|
|
|
|
|
patientInfo
|
|
|
|
|
.appointmentDate.isNotEmpty)
|
|
|
|
|
? AppText(
|
|
|
|
|
"${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(
|
|
|
|
|
patientInfo.appointmentDate,
|
|
|
|
|
))} ${AppDateUtils.getStartTime(patientInfo.startTime)}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
? Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(
|
|
|
|
|
patientInfo
|
|
|
|
|
.appointmentDate,
|
|
|
|
|
), isMonthShort: true)}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
" ${AppDateUtils.getStartTime(patientInfo.startTime)}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: SizedBox()
|
|
|
|
|
],
|
|
|
|
|
@ -216,7 +266,9 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 12,
|
|
|
|
|
),
|
|
|
|
|
PatientStatus(label:'My Patient',),
|
|
|
|
|
PatientStatus(
|
|
|
|
|
label: 'My Patient',
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
@ -229,8 +281,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
flex: 2,
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
isFromLiveCare
|
|
|
|
|
@ -259,7 +310,6 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
DoctorApp.female_1,
|
|
|
|
|
color: Colors.pink,
|
|
|
|
|
size: 18,
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
if (isFromLiveCare)
|
|
|
|
|
ShowTimer(
|
|
|
|
|
@ -311,99 +361,105 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
SizedBox(height: 10,),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 12.0,top: 5),
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 60,
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
patientInfo.gender == 1
|
|
|
|
|
? 'assets/images/male_avatar.png'
|
|
|
|
|
: 'assets/images/female_avatar.png',
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 12.0, top: 5),
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 60,
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
patientInfo.gender == 1
|
|
|
|
|
? 'assets/images/male_avatar.png'
|
|
|
|
|
: 'assets/images/female_avatar.png',
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
// SizedBox(height: 10,),
|
|
|
|
|
CustomRow(
|
|
|
|
|
label:
|
|
|
|
|
TranslationBase.of(context).fileNumber,
|
|
|
|
|
value: patientInfo.patientId.toString(),
|
|
|
|
|
),
|
|
|
|
|
CustomRow(
|
|
|
|
|
label:
|
|
|
|
|
TranslationBase.of(context).age + " : ",
|
|
|
|
|
value:
|
|
|
|
|
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
|
|
|
|
|
),
|
|
|
|
|
if (isInpatient)
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: patientInfo.admissionDate == null
|
|
|
|
|
? ""
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
.admissionDate +
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
// SizedBox(height: 10,),
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
.fileNumber,
|
|
|
|
|
value: patientInfo.patientId.toString(),
|
|
|
|
|
),
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).age +
|
|
|
|
|
" : ",
|
|
|
|
|
value:
|
|
|
|
|
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
|
|
|
|
|
),
|
|
|
|
|
if (isInpatient)
|
|
|
|
|
CustomRow(
|
|
|
|
|
label:
|
|
|
|
|
patientInfo.admissionDate == null
|
|
|
|
|
? ""
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
.admissionDate +
|
|
|
|
|
" : ",
|
|
|
|
|
value: patientInfo.admissionDate ==
|
|
|
|
|
null
|
|
|
|
|
? ""
|
|
|
|
|
: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate.toString()), isMonthShort: true)}",
|
|
|
|
|
),
|
|
|
|
|
if (patientInfo.admissionDate != null)
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
.numOfDays +
|
|
|
|
|
" : ",
|
|
|
|
|
value: patientInfo.admissionDate == null
|
|
|
|
|
? ""
|
|
|
|
|
: "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
|
|
|
|
|
),
|
|
|
|
|
if (patientInfo.admissionDate != null)
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
.numOfDays +
|
|
|
|
|
" : ",
|
|
|
|
|
value:
|
|
|
|
|
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
|
|
|
|
|
),
|
|
|
|
|
if (patientInfo.admissionDate != null)
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
.clinicName +
|
|
|
|
|
" : ",
|
|
|
|
|
value: "${patientInfo.clinicDescription}",
|
|
|
|
|
),
|
|
|
|
|
if (patientInfo.admissionDate != null)
|
|
|
|
|
CustomRow(
|
|
|
|
|
label:
|
|
|
|
|
TranslationBase.of(context).roomNo +
|
|
|
|
|
value:
|
|
|
|
|
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
|
|
|
|
|
),
|
|
|
|
|
if (patientInfo.admissionDate != null)
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
.clinicName +
|
|
|
|
|
" : ",
|
|
|
|
|
value: "${patientInfo.roomId}",
|
|
|
|
|
),
|
|
|
|
|
if (isFromLiveCare)
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
value:
|
|
|
|
|
"${patientInfo.clinicDescription}",
|
|
|
|
|
),
|
|
|
|
|
if (patientInfo.admissionDate != null)
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
.clinic +
|
|
|
|
|
.roomNo +
|
|
|
|
|
" : ",
|
|
|
|
|
value: patientInfo.clinicName,
|
|
|
|
|
value: "${patientInfo.roomId}",
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward,
|
|
|
|
|
size: 24,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
]),
|
|
|
|
|
if (isFromLiveCare)
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
.clinic +
|
|
|
|
|
" : ",
|
|
|
|
|
value: patientInfo.clinicName,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward,
|
|
|
|
|
size: 24,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
]),
|
|
|
|
|
isFromLiveCare
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
@ -459,16 +515,19 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class PatientStatus extends StatelessWidget {
|
|
|
|
|
PatientStatus({
|
|
|
|
|
Key key, this.label, this.color,
|
|
|
|
|
PatientStatus({
|
|
|
|
|
Key key,
|
|
|
|
|
this.label,
|
|
|
|
|
this.color,
|
|
|
|
|
}) : super(key: key);
|
|
|
|
|
final String label;final Color color;
|
|
|
|
|
final String label;
|
|
|
|
|
final Color color;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return AppText(
|
|
|
|
|
label,
|
|
|
|
|
color: color??AppGlobal.appGreenColor,
|
|
|
|
|
color: color ?? AppGlobal.appGreenColor,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
|