|
|
|
@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
@ -32,36 +33,22 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
return Container(
|
|
|
|
|
width: SizeConfig.screenWidth * 0.9,
|
|
|
|
|
margin: EdgeInsets.all(6),
|
|
|
|
|
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
|
|
|
|
|
padding: EdgeInsets.only(left: 0, right: 5, bottom: 0, top: 0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(15),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Stack(children: [
|
|
|
|
|
if (!isInpatient&& !isMyPatient && !isFromSearch)
|
|
|
|
|
Container(
|
|
|
|
|
height: 160,
|
|
|
|
|
width: 5,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(10),
|
|
|
|
|
bottomLeft: Radius.circular(10)),
|
|
|
|
|
color: patientInfo.patientStatusType == 43
|
|
|
|
|
? 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: CardWithBgWidget(
|
|
|
|
|
padding: 0,
|
|
|
|
|
marginLeft: (!isMyPatient && isInpatient)?0:10,
|
|
|
|
|
marginSymmetric:isFromSearch ? 10 : 0.0,
|
|
|
|
|
hasBorder: false,
|
|
|
|
|
bgColor:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43
|
|
|
|
|
? Colors.green[500]
|
|
|
|
|
:isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white,
|
|
|
|
|
widget: Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
// padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
@ -82,7 +69,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
|
|
|
|
@ -92,7 +79,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
color: patientInfo.status==2? Colors.green:Colors.grey ,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
@ -103,7 +90,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
|
|
|
|
@ -113,7 +100,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
color: patientInfo.status==2? Colors.green:Colors.grey ,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
): !isFromSearch && patientInfo.patientStatusType==null ? Row(
|
|
|
|
@ -151,14 +138,15 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
)+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
)
|
|
|
|
|
: (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)?
|
|
|
|
|
AppText(
|
|
|
|
|
//
|
|
|
|
|
// )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)),
|
|
|
|
|
" ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}",
|
|
|
|
|
|
|
|
|
|
"${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
):SizedBox()
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
@ -181,29 +169,31 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Row(children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: 170,
|
|
|
|
|
child: AppText(
|
|
|
|
|
(Helpers.capitalize(patientInfo.firstName) +
|
|
|
|
|
" " +
|
|
|
|
|
Helpers.capitalize(patientInfo.lastName)),
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
textOverflow: TextOverflow.ellipsis,
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
// width: MediaQuery.of(context).size.width*0.51,
|
|
|
|
|
child: AppText(
|
|
|
|
|
(Helpers.capitalize(patientInfo.firstName) +
|
|
|
|
|
" " +
|
|
|
|
|
Helpers.capitalize(patientInfo.lastName)),
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
color: Color(0xff2e303a),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
textOverflow: TextOverflow.ellipsis,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
patientInfo.gender == 1
|
|
|
|
|
? Icon(
|
|
|
|
|
DoctorApp.male_2,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
)
|
|
|
|
|
: Icon(
|
|
|
|
|
DoctorApp.female_1,
|
|
|
|
|
color: Colors.pink,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
if (patientInfo.gender == 1)
|
|
|
|
|
Icon(
|
|
|
|
|
DoctorApp.male_2,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
) else Icon(
|
|
|
|
|
DoctorApp.female_1,
|
|
|
|
|
color: Colors.pink,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
@ -280,14 +270,14 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
text: TranslationBase.of(context)
|
|
|
|
|
.fileNumber,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontFamily: 'Poppins')),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: patientInfo.patientId.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 15)),
|
|
|
|
|
fontSize: 13)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -306,13 +296,13 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
text:
|
|
|
|
|
TranslationBase.of(context).age +
|
|
|
|
|
" : ",
|
|
|
|
|
style: TextStyle(fontSize: 14)),
|
|
|
|
|
style: TextStyle(fontSize: 12)),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text:
|
|
|
|
|
"${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 15)),
|
|
|
|
|
fontSize: 13)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -334,28 +324,35 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
.admissionDate +
|
|
|
|
|
" : ",
|
|
|
|
|
style: TextStyle(fontSize: 14)),
|
|
|
|
|
style: TextStyle(fontSize: 12)),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: patientInfo.admissionDate == null
|
|
|
|
|
? ""
|
|
|
|
|
: "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 15)),
|
|
|
|
|
fontSize: 13)),
|
|
|
|
|
]))),
|
|
|
|
|
if (patientInfo.admissionDate != null)
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"${TranslationBase.of(context).numOfDays}: ",
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
fontWeight: FontWeight.w700),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: RichText(
|
|
|
|
|
text: new TextSpan(
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize:
|
|
|
|
|
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(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 13)),
|
|
|
|
|
]))),
|
|
|
|
|
|
|
|
|
|
]))
|
|
|
|
|
]),
|
|
|
|
@ -395,7 +392,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
)),
|
|
|
|
|
]));
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|