generate med cert window enhancement

This commit is contained in:
2024-09-27 13:00:16 +02:00
parent 5fb8e1dcc4
commit fb615d9c3f

View File

@@ -249,55 +249,28 @@ class _PatientFilesState extends State<PatientFiles> {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (context) => Dialog( builder: (context) => MIHWindow(
child: Stack( fullscreen: false,
children: [ windowTitle: "Create Medical Certificate",
Container( windowTools: const [],
padding: const EdgeInsets.all(10.0), onWindowTapClose: () {
width: 700.0, Navigator.pop(context);
//height: 475.0, },
decoration: BoxDecoration( windowBody: [
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( Medcertinput(
startDateController: startDateController, startDateController: startDateController,
endDateTextController: endDateTextController, endDateTextController: endDateTextController,
retDateTextController: retDateTextController, retDateTextController: retDateTextController,
), ),
const SizedBox(height: 30.0), const SizedBox(height: 15.0),
SizedBox( SizedBox(
width: 300, width: 300,
height: 50, height: 50,
child: MIHButton( child: MIHButton(
buttonText: "Generate", buttonText: "Generate",
buttonColor: MzanziInnovationHub.of(context)! buttonColor:
.theme MzanziInnovationHub.of(context)!.theme.secondaryColor(),
.secondaryColor(), textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
textColor: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
onTap: () async { onTap: () async {
if (isMedCertFieldsFilled()) { if (isMedCertFieldsFilled()) {
await generateMedCert(); await generateMedCert();
@@ -306,8 +279,7 @@ class _PatientFilesState extends State<PatientFiles> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MIHErrorMessage( return const MIHErrorMessage(errorType: "Input Error");
errorType: "Input Error");
}, },
); );
} }
@@ -316,28 +288,100 @@ class _PatientFilesState extends State<PatientFiles> {
) )
], ],
), ),
),
),
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() { void prescritionPopUp() {