simple changes

merge-requests/263/head
mosazaid 5 years ago
parent e808d48035
commit cd95a581f0

@ -40,7 +40,8 @@ class MyReferralDetailScreen extends StatelessWidget {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
body: model.patientArrivalList != null ? Column(
body: model.patientArrivalList != null
? Column(
children: [
Expanded(
child: SingleChildScrollView(
@ -52,7 +53,8 @@ class MyReferralDetailScreen extends StatelessWidget {
AppText(
authProvider.selectedClinicName != null
? authProvider.selectedClinicName
: authProvider.doctorProfile.clinicDescription,
: authProvider
.doctorProfile.clinicDescription,
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white,
textAlign: TextAlign.center,
@ -63,7 +65,8 @@ class MyReferralDetailScreen extends StatelessWidget {
height: 16,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: AppText(
TranslationBase.of(context).myReferralPatient,
color: Colors.black,
@ -87,34 +90,39 @@ class MyReferralDetailScreen extends StatelessWidget {
childAspectRatio: 1.8,
crossAxisSpacing: 8,
mainAxisSpacing: 10,
controller:
new ScrollController(keepScrollOffset: false),
controller: new ScrollController(
keepScrollOffset: false),
shrinkWrap: true,
padding: const EdgeInsets.all(4.0),
crossAxisCount: 2,
children: [
PatientProfileButton(
key: key,
// patient: patient,
// route: RADIOLOGY,
nameLine1:
TranslationBase.of(context).previewHealth,
nameLine2:
TranslationBase.of(context).summaryReport,
patient: model.patientArrivalList[0],
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context)
.previewHealth,
nameLine2: TranslationBase.of(context)
.summaryReport,
icon: 'radiology-1.png'),
PatientProfileButton(
key: key,
// patient: patient,
// route: LAB_ORDERS,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
patient: model.patientArrivalList[0],
route: LAB_ORDERS,
nameLine1:
TranslationBase.of(context).lab,
nameLine2:
TranslationBase.of(context).result,
icon: 'lab.png'),
PatientProfileButton(
key: key,
patient: model.patientArrivalList[0],
route: VITAL_SIGN_DETAILS /*PATIENT_VITAL_SIGN*/,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route:
VITAL_SIGN_DETAILS /*PATIENT_VITAL_SIGN*/,
nameLine1:
TranslationBase.of(context).vital,
nameLine2:
TranslationBase.of(context).signs,
icon: 'heartbeat.png'),
],
),
@ -161,7 +169,8 @@ class MyReferralDetailScreen extends StatelessWidget {
),
),
],
) : Container(
)
: Container(
child: Center(
child: AppText(
TranslationBase.of(context).patientNoDetailErrMsg,

@ -18,6 +18,24 @@ import './profile_medical_info_widget.dart';
class PatientProfileWidget extends StatelessWidget {
PatiantInformtion patient;
String getPatientAge(dynamic birthday){
// https://leechy.dev/calculate-dates-diff-in-dart
DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday);
final now = DateTime.now();
int years = now.year - birthDate .year;
int months = now.month - birthDate.month;
int days = now.day - birthDate.day;
if (months < 0 || (months == 0 && days < 0)) {
years--;
months += (days < 0 ? 11 : 12);
}
if (days < 0) {
final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day);
days = now.difference(monthAgo).inDays + 1;
}
return "$years Yr $months Mnth $days Day";
}
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
@ -115,7 +133,7 @@ class PatientProfileWidget extends StatelessWidget {
height: 4,
),
AppText(
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${patient.age}",
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${getPatientAge(patient.dateofBirth)/*patient.age*/}",
fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier,
),

Loading…
Cancel
Save