From f89eb0f76b46939a0b9ffade9738fe66bf5d6bcb Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 7 Apr 2021 17:49:29 +0300 Subject: [PATCH] Procedure screen changes --- .../medical-file/medical_file_page.dart | 2 +- .../prescription/prescriptions_page.dart | 2 +- lib/screens/procedures/ProcedureCard.dart | 54 +++++++++++++--- lib/screens/procedures/procedure_screen.dart | 61 ++++++++++--------- 4 files changed, 81 insertions(+), 38 deletions(-) diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 68ac3973..46ec0ac3 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -40,7 +40,7 @@ class _MedicalFilePageState extends State { (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", patientType), + patient, patientType.toString() ?? "0", arrivalType), isShowAppBar: true, appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 62939fc5..ba707769 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -33,7 +33,7 @@ class PrescriptionsPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType), + patient, patientType ?? '0', arrivalType), body: FractionallySizedBox( widthFactor: 1.0, child: ListView( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 4fd632cf..31595fa6 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -10,8 +10,16 @@ import 'package:provider/provider.dart'; class ProcedureCard extends StatelessWidget { final Function onTap; final EntityList entityList; + final String categoryName; + final int categoryID; - const ProcedureCard({Key key, this.onTap, this.entityList}) : super(key: key); + const ProcedureCard( + {Key key, + this.onTap, + this.entityList, + this.categoryID, + this.categoryName}) + : super(key: key); @override Widget build(BuildContext context) { @@ -37,9 +45,8 @@ class ProcedureCard extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: entityList.orderType == 1 - ? Colors.red[500] - : Colors.black, + color: + entityList.orderType == 1 ? Colors.red[500] : Colors.black, ), ), Expanded( @@ -105,12 +112,43 @@ class ProcedureCard extends StatelessWidget { children: [ Texts( TranslationBase.of(context).orderNo, - color: Colors.grey, + //color: Colors.grey, fontSize: 12, + color: Colors.grey, ), Texts( entityList.orderNo.toString(), + fontSize: 12, + bold: true, + ), + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).doctorName + ": ", + //color: Colors.grey, + fontSize: 12, color: Colors.grey, + ), + Texts( + entityList.doctorName.toString(), + fontSize: 12, + bold: true, + ), + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).clinic + ": ", + //color: Colors.grey, + fontSize: 12, + color: Colors.grey, + ), + Texts( + entityList.clinicDescription.toString(), + bold: true, fontSize: 12, ), ], @@ -119,10 +157,12 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts( - entityList.remarks ?? '', + entityList.remarks.toString() ?? '', fontSize: 12, ), - Icon(Icons.edit) + if (entityList.categoryID == 2 || + entityList.categoryID == 4) + Icon(Icons.edit) ], ) ], diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 3c46cd3f..7d95fd35 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -29,7 +29,8 @@ class ProcedureScreen extends StatelessWidget { builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType), + appBar: PatientProfileHeaderNewDesignAppBar( + patient, arrivalType ?? '0', patientType), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -110,36 +111,38 @@ class ProcedureScreen extends StatelessWidget { ...List.generate( model.procedureList[0].rowcount, (index) => ProcedureCard( + categoryID: + model.procedureList[0].entityList[index].categoryID, entityList: model.procedureList[0].entityList[index], onTap: () { - if (model.procedureList[0].entityList[index] - .categoryID == - 2 || - model.procedureList[0].entityList[index] - .categoryID == - 4) { - updateProcedureForm(context, - model: model, - patient: patient, - remarks: model - .procedureList[0].entityList[index].remarks, - orderType: model.procedureList[0] - .entityList[index].orderType - .toString(), - orderNo: model - .procedureList[0].entityList[index].orderNo, - procedureName: model.procedureList[0] - .entityList[index].procedureName, - categoreId: model.procedureList[0] - .entityList[index].categoryID - .toString(), - procedureId: model.procedureList[0] - .entityList[index].procedureId, - limetNo: model.procedureList[0] - .entityList[index].lineItemNo); - } else - helpers.showErrorToast( - 'You Cant Update This Procedure'); + // if (model.procedureList[0].entityList[index] + // .categoryID == + // 2 || + // model.procedureList[0].entityList[index] + // .categoryID == + // 4) { + updateProcedureForm(context, + model: model, + patient: patient, + remarks: model + .procedureList[0].entityList[index].remarks, + orderType: model + .procedureList[0].entityList[index].orderType + .toString(), + orderNo: model + .procedureList[0].entityList[index].orderNo, + procedureName: model.procedureList[0] + .entityList[index].procedureName, + categoreId: model + .procedureList[0].entityList[index].categoryID + .toString(), + procedureId: model.procedureList[0] + .entityList[index].procedureId, + limetNo: model.procedureList[0].entityList[index] + .lineItemNo); + // } else + // helpers.showErrorToast( + // 'You Cant Update This Procedure'); }, ), ),