|
|
|
@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
|
|
|
|
|
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 'ShowTimer.dart';
|
|
|
|
|
|
|
|
|
@ -81,8 +82,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.arrivedP,
|
|
|
|
|
TranslationBase.of(context).arrivedP,
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
@ -102,12 +102,8 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? 'Confirmed'
|
|
|
|
|
: 'Booked',
|
|
|
|
|
color: patientInfo.status == 2
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.grey,
|
|
|
|
|
patientInfo.status == 2 ? 'Confirmed' : 'Booked',
|
|
|
|
|
color: patientInfo.status == 2 ? Colors.green : Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 10,
|
|
|
|
@ -118,8 +114,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.notArrived,
|
|
|
|
|
TranslationBase.of(context).notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
@ -139,27 +134,19 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? 'Confirmed'
|
|
|
|
|
: 'Booked',
|
|
|
|
|
color: patientInfo.status == 2
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.grey,
|
|
|
|
|
patientInfo.status == 2 ? 'Confirmed' : 'Booked',
|
|
|
|
|
color: patientInfo.status == 2 ? Colors.green : Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: !isFromSearch &&
|
|
|
|
|
!isFromLiveCare &&
|
|
|
|
|
patientInfo.patientStatusType ==
|
|
|
|
|
null
|
|
|
|
|
: !isFromSearch && !isFromLiveCare && patientInfo.patientStatusType == null
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.notArrived,
|
|
|
|
|
TranslationBase.of(context).notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
@ -179,13 +166,8 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? 'Booked'
|
|
|
|
|
: 'Confirmed',
|
|
|
|
|
color:
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? Colors.grey
|
|
|
|
|
: Colors.green,
|
|
|
|
|
patientInfo.status == 2 ? 'Booked' : 'Confirmed',
|
|
|
|
|
color: patientInfo.status == 2 ? Colors.grey : Colors.green,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
@ -195,17 +177,13 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
this.arrivalType == '1'
|
|
|
|
|
? AppText(
|
|
|
|
|
patientInfo.startTime != null
|
|
|
|
|
? patientInfo.startTime
|
|
|
|
|
: patientInfo.startTimes,
|
|
|
|
|
patientInfo.startTime != null ? patientInfo.startTime : patientInfo.startTimes,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
)
|
|
|
|
|
: patientInfo.arrivedOn != null
|
|
|
|
|
? AppText(
|
|
|
|
|
AppDateUtils.getDayMonthYearDate(
|
|
|
|
|
AppDateUtils
|
|
|
|
|
.convertStringToDate(
|
|
|
|
|
AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(
|
|
|
|
|
patientInfo.arrivedOn,
|
|
|
|
|
)) +
|
|
|
|
|
" " +
|
|
|
|
@ -214,10 +192,8 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
)
|
|
|
|
|
: (patientInfo.appointmentDate !=
|
|
|
|
|
null &&
|
|
|
|
|
patientInfo
|
|
|
|
|
.appointmentDate.isNotEmpty)
|
|
|
|
|
: (patientInfo.appointmentDate != null &&
|
|
|
|
|
patientInfo.appointmentDate.isNotEmpty)
|
|
|
|
|
? AppText(
|
|
|
|
|
"${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(
|
|
|
|
|
patientInfo.appointmentDate,
|
|
|
|
@ -256,13 +232,10 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
// width: MediaQuery.of(context).size.width*0.51,
|
|
|
|
|
child: AppText(
|
|
|
|
|
isFromLiveCare
|
|
|
|
|
? Helpers.capitalize(
|
|
|
|
|
patientInfo.fullName)
|
|
|
|
|
: (Helpers.capitalize(
|
|
|
|
|
patientInfo.firstName) +
|
|
|
|
|
? Helpers.capitalize(patientInfo.fullName)
|
|
|
|
|
: (Helpers.capitalize(patientInfo.firstName) +
|
|
|
|
|
" " +
|
|
|
|
|
Helpers.capitalize(
|
|
|
|
|
patientInfo.lastName)),
|
|
|
|
|
Helpers.capitalize(patientInfo.lastName)),
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
color: Color(0xff2e303a),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
@ -300,25 +273,19 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
textOverflow: TextOverflow.ellipsis,
|
|
|
|
|
),
|
|
|
|
|
patientInfo.nationality != null ||
|
|
|
|
|
patientInfo.nationalityId != null
|
|
|
|
|
patientInfo.nationality != null || patientInfo.nationalityId != null
|
|
|
|
|
? ClipRRect(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(20.0),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
patientInfo.nationalityFlagURL != null
|
|
|
|
|
borderRadius: BorderRadius.circular(20.0),
|
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
|
imageUrl: patientInfo.nationalityFlagURL != null
|
|
|
|
|
? patientInfo.nationalityFlagURL
|
|
|
|
|
: '',
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 30,
|
|
|
|
|
errorBuilder: (BuildContext context,
|
|
|
|
|
Object exception,
|
|
|
|
|
StackTrace stackTrace) {
|
|
|
|
|
return AppText(
|
|
|
|
|
'No Image',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
errorWidget: (context, url, error) => AppText(
|
|
|
|
|
'No Image',
|
|
|
|
|
fontSize: 7.5,
|
|
|
|
|
),
|
|
|
|
|
))
|
|
|
|
|
: SizedBox()
|
|
|
|
|
],
|
|
|
|
@ -348,58 +315,51 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).fileNumber,
|
|
|
|
|
value: patientInfo.patientId.toString(),
|
|
|
|
|
),
|
|
|
|
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).fileNumber,
|
|
|
|
|
value: patientInfo.patientId.toString(),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
//if (isInpatient)
|
|
|
|
|
//if (isInpatient)
|
|
|
|
|
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).age + " : ",
|
|
|
|
|
value:
|
|
|
|
|
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
|
|
|
|
|
),
|
|
|
|
|
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.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).roomNo + " : ",
|
|
|
|
|
value: "${patientInfo.roomId}",
|
|
|
|
|
),
|
|
|
|
|
if (isInpatient)
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: patientInfo.admissionDate == null
|
|
|
|
|
? ""
|
|
|
|
|
: TranslationBase.of(context).admissionDate + " : ",
|
|
|
|
|
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).roomNo + " : ",
|
|
|
|
|
value: "${patientInfo.roomId}",
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
if (isFromLiveCare)
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).clinic +
|
|
|
|
|
" : ",
|
|
|
|
|
value: patientInfo.clinicName,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
if (isFromLiveCare)
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).clinic + " : ",
|
|
|
|
|
value: patientInfo.clinicName,
|
|
|
|
|
),
|
|
|
|
|
]))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
]))
|
|
|
|
|
]),
|
|
|
|
|
isFromLiveCare
|
|
|
|
|
? Row(
|
|
|
|
@ -416,36 +376,29 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: !isInpatient && !isFromSearch
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
? Row(mainAxisAlignment: MainAxisAlignment.end, children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100
|
|
|
|
|
? 'assets/images/livecare.png'
|
|
|
|
|
: patientInfo.appointmentType == 'Walkin'
|
|
|
|
|
? 'assets/images/walkin.png'
|
|
|
|
|
: 'assets/images/booked.png',
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 35,
|
|
|
|
|
)),
|
|
|
|
|
])
|
|
|
|
|
: (isInpatient == true)
|
|
|
|
|
? Row(mainAxisAlignment: MainAxisAlignment.end, children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
patientInfo.appointmentType ==
|
|
|
|
|
'Regular' &&
|
|
|
|
|
patientInfo.visitTypeId == 100
|
|
|
|
|
? 'assets/images/livecare.png'
|
|
|
|
|
: patientInfo.appointmentType ==
|
|
|
|
|
'Walkin'
|
|
|
|
|
? 'assets/images/walkin.png'
|
|
|
|
|
: 'assets/images/booked.png',
|
|
|
|
|
'assets/images/inpatient.png',
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 35,
|
|
|
|
|
)),
|
|
|
|
|
])
|
|
|
|
|
: (isInpatient == true)
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
'assets/images/inpatient.png',
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 35,
|
|
|
|
|
)),
|
|
|
|
|
])
|
|
|
|
|
: SizedBox()
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
@ -454,5 +407,3 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|