|
|
|
|
@ -16,13 +16,16 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
final String patientType;
|
|
|
|
|
final String arrivalType;
|
|
|
|
|
final bool isInpatient;
|
|
|
|
|
final bool isMyPatient;
|
|
|
|
|
final bool isFromSearch;
|
|
|
|
|
|
|
|
|
|
const PatientCard(
|
|
|
|
|
{Key key,
|
|
|
|
|
this.patientInfo,
|
|
|
|
|
this.onTap,
|
|
|
|
|
this.patientType,
|
|
|
|
|
this.arrivalType,
|
|
|
|
|
this.isInpatient})
|
|
|
|
|
this.isInpatient, this.isMyPatient = false, this.isFromSearch = false})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
@ -35,9 +38,9 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Stack(children: [
|
|
|
|
|
if (isInpatient)
|
|
|
|
|
if (!isInpatient&& !isMyPatient && !isFromSearch)
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * .20,
|
|
|
|
|
height: 160,
|
|
|
|
|
width: 5,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
@ -47,6 +50,16 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
? Colors.green[500]
|
|
|
|
|
: Colors.red[800],
|
|
|
|
|
)),
|
|
|
|
|
if(isMyPatient && !isFromSearch)
|
|
|
|
|
Container(
|
|
|
|
|
height: 180,
|
|
|
|
|
width: 5,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(10),
|
|
|
|
|
bottomLeft: Radius.circular(10)),
|
|
|
|
|
color: Colors.green[500]
|
|
|
|
|
)),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
@ -55,47 +68,113 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
!isInpatient
|
|
|
|
|
!(isInpatient && !isFromSearch)
|
|
|
|
|
? Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 12.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
patientInfo.patientStatusType == 43
|
|
|
|
|
? AppText(
|
|
|
|
|
TranslationBase.of(context).arrivedP,
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
)
|
|
|
|
|
: AppText(
|
|
|
|
|
TranslationBase.of(context).notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).arrivedP,
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status==2? 'Confirmed':'Booked',
|
|
|
|
|
color: patientInfo.status==2? Colors.green:Colors.grey ,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: patientInfo.patientStatusType == 42?Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status==2? 'Confirmed':'Booked',
|
|
|
|
|
color: patientInfo.status==2? Colors.green:Colors.grey ,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
): !isFromSearch?Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status==2? 'Confirmed':'Booked',
|
|
|
|
|
color: patientInfo.status==2? Colors.green:Colors.grey ,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
):SizedBox(),
|
|
|
|
|
this.arrivalType == '1'
|
|
|
|
|
? AppText(
|
|
|
|
|
patientInfo.startTime != null
|
|
|
|
|
? patientInfo.startTime
|
|
|
|
|
: patientInfo.startTimes,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
)
|
|
|
|
|
: patientInfo.arrivedOn != null
|
|
|
|
|
? AppText(
|
|
|
|
|
DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate(
|
|
|
|
|
patientInfo.arrivedOn,
|
|
|
|
|
)),
|
|
|
|
|
DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,)
|
|
|
|
|
)+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.arrivedOn,)),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
)
|
|
|
|
|
: SizedBox()
|
|
|
|
|
: (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)?
|
|
|
|
|
AppText(
|
|
|
|
|
DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,)
|
|
|
|
|
)+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
):SizedBox()
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
if(isInpatient && isMyPatient && !isFromSearch)
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(width: 12,),
|
|
|
|
|
AppText(
|
|
|
|
|
'My Patient',
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 12.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
@ -212,7 +291,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (isInpatient)
|
|
|
|
|
//if (isInpatient)
|
|
|
|
|
Container(
|
|
|
|
|
child: RichText(
|
|
|
|
|
text: new TextSpan(
|
|
|
|
|
@ -368,7 +447,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
//)
|
|
|
|
|
]))
|
|
|
|
|
]),
|
|
|
|
|
!isInpatient
|
|
|
|
|
!isInpatient && !isFromSearch
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
|