From fb615d9c3f0c3fe4b108160f42568f6f5e094974 Mon Sep 17 00:00:00 2001 From: yaso Date: Fri, 27 Sep 2024 13:00:16 +0200 Subject: [PATCH] generate med cert window enhancement --- .../patient_profile/patient_files.dart | 216 +++++++++++------- 1 file changed, 130 insertions(+), 86 deletions(-) diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_files.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_files.dart index eccdd31a..b1498c61 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_files.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_files.dart @@ -249,95 +249,139 @@ class _PatientFilesState extends State { showDialog( context: context, barrierDismissible: false, - builder: (context) => Dialog( - child: Stack( - children: [ - Container( - padding: const EdgeInsets.all(10.0), - width: 700.0, - //height: 475.0, - decoration: BoxDecoration( - color: MzanziInnovationHub.of(context)!.theme.primaryColor(), - borderRadius: BorderRadius.circular(25.0), - border: Border.all( - color: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - width: 5.0), - ), - child: SingleChildScrollView( - padding: const EdgeInsets.symmetric(horizontal: 10), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - "Create Medical Certificate", - textAlign: TextAlign.center, - style: TextStyle( - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - fontSize: 35.0, - fontWeight: FontWeight.bold, - ), - ), - const SizedBox(height: 25.0), - Medcertinput( - startDateController: startDateController, - endDateTextController: endDateTextController, - retDateTextController: retDateTextController, - ), - const SizedBox(height: 30.0), - SizedBox( - width: 300, - height: 50, - child: MIHButton( - buttonText: "Generate", - buttonColor: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - textColor: MzanziInnovationHub.of(context)! - .theme - .primaryColor(), - onTap: () async { - if (isMedCertFieldsFilled()) { - await generateMedCert(); - //Navigator.pop(context); - } else { - showDialog( - context: context, - builder: (context) { - return const MIHErrorMessage( - errorType: "Input Error"); - }, - ); - } - }, - ), - ) - ], - ), - ), + builder: (context) => MIHWindow( + fullscreen: false, + windowTitle: "Create Medical Certificate", + windowTools: const [], + onWindowTapClose: () { + Navigator.pop(context); + }, + windowBody: [ + Medcertinput( + startDateController: startDateController, + endDateTextController: endDateTextController, + retDateTextController: retDateTextController, + ), + const SizedBox(height: 15.0), + SizedBox( + width: 300, + height: 50, + child: MIHButton( + buttonText: "Generate", + buttonColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + onTap: () async { + if (isMedCertFieldsFilled()) { + await generateMedCert(); + //Navigator.pop(context); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage(errorType: "Input Error"); + }, + ); + } + }, ), - Positioned( - top: 5, - right: 5, - width: 50, - height: 50, - child: IconButton( - onPressed: () { - Navigator.pop(context); - }, - icon: Icon( - Icons.close, - color: MzanziInnovationHub.of(context)!.theme.errorColor(), - size: 35, - ), - ), - ), - ], - ), + ) + ], ), ); + + // showDialog( + // context: context, + // barrierDismissible: false, + // builder: (context) => Dialog( + // child: Stack( + // children: [ + // Container( + // padding: const EdgeInsets.all(10.0), + // width: 700.0, + // //height: 475.0, + // decoration: BoxDecoration( + // color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + // borderRadius: BorderRadius.circular(25.0), + // border: Border.all( + // color: + // MzanziInnovationHub.of(context)!.theme.secondaryColor(), + // width: 5.0), + // ), + // child: SingleChildScrollView( + // padding: const EdgeInsets.symmetric(horizontal: 10), + // child: Column( + // mainAxisSize: MainAxisSize.min, + // children: [ + // Text( + // "Create Medical Certificate", + // textAlign: TextAlign.center, + // style: TextStyle( + // color: MzanziInnovationHub.of(context)! + // .theme + // .secondaryColor(), + // fontSize: 35.0, + // fontWeight: FontWeight.bold, + // ), + // ), + // const SizedBox(height: 25.0), + // Medcertinput( + // startDateController: startDateController, + // endDateTextController: endDateTextController, + // retDateTextController: retDateTextController, + // ), + // const SizedBox(height: 30.0), + // SizedBox( + // width: 300, + // height: 50, + // child: MIHButton( + // buttonText: "Generate", + // buttonColor: MzanziInnovationHub.of(context)! + // .theme + // .secondaryColor(), + // textColor: MzanziInnovationHub.of(context)! + // .theme + // .primaryColor(), + // onTap: () async { + // if (isMedCertFieldsFilled()) { + // await generateMedCert(); + // //Navigator.pop(context); + // } else { + // showDialog( + // context: context, + // builder: (context) { + // return const MIHErrorMessage( + // errorType: "Input Error"); + // }, + // ); + // } + // }, + // ), + // ) + // ], + // ), + // ), + // ), + // Positioned( + // top: 5, + // right: 5, + // width: 50, + // height: 50, + // child: IconButton( + // onPressed: () { + // Navigator.pop(context); + // }, + // icon: Icon( + // Icons.close, + // color: MzanziInnovationHub.of(context)!.theme.errorColor(), + // size: 35, + // ), + // ), + // ), + // ], + // ), + // ), + // ); } void prescritionPopUp() {