prescription generator window enhancement

This commit is contained in:
2024-09-27 12:56:28 +02:00
parent 7332582628
commit 5fb8e1dcc4
2 changed files with 76 additions and 144 deletions

View File

@@ -344,40 +344,20 @@ 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 Prescription",
Container( windowTools: const [],
padding: const EdgeInsets.all(10.0), onWindowTapClose: () {
width: 900.0, medicineController.clear();
//height: 475.0, quantityController.clear();
decoration: BoxDecoration( dosageController.clear();
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), timesDailyController.clear();
borderRadius: BorderRadius.circular(25.0), noDaysController.clear();
border: Border.all( noRepeatsController.clear();
color: Navigator.pop(context);
MzanziInnovationHub.of(context)!.theme.secondaryColor(), },
width: 5.0), windowBody: [
),
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Text(
"Create Perscription",
textAlign: TextAlign.center,
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
fontSize: 35.0,
fontWeight: FontWeight.bold,
),
),
//const SizedBox(height: 25.0),
PrescripInput( PrescripInput(
medicineController: medicineController, medicineController: medicineController,
quantityController: quantityController, quantityController: quantityController,
@@ -393,33 +373,6 @@ class _PatientFilesState extends State<PatientFiles> {
), ),
], ],
), ),
),
),
Positioned(
top: 5,
right: 5,
width: 50,
height: 50,
child: IconButton(
onPressed: () {
medicineController.clear();
quantityController.clear();
dosageController.clear();
timesDailyController.clear();
noDaysController.clear();
noRepeatsController.clear();
Navigator.pop(context);
},
icon: Icon(
Icons.close,
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
size: 35,
),
),
),
],
),
),
); );
} }

View File

@@ -344,7 +344,7 @@ class _PrescripInputState extends State<PrescripInput> {
Widget displayMedInput() { Widget displayMedInput() {
return Column( return Column(
children: [ children: [
const SizedBox(height: 25.0), //const SizedBox(height: 25.0),
KeyboardListener( KeyboardListener(
focusNode: _focusNode, focusNode: _focusNode,
@@ -355,8 +355,6 @@ class _PrescripInputState extends State<PrescripInput> {
getMedsPopUp(widget.medicineController); getMedsPopUp(widget.medicineController);
} }
}, },
child: SizedBox(
width: 300,
child: MIHSearchField( child: MIHSearchField(
controller: widget.medicineController, controller: widget.medicineController,
hintText: "Medicine", hintText: "Medicine",
@@ -367,7 +365,6 @@ class _PrescripInputState extends State<PrescripInput> {
}, },
), ),
), ),
),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
// SizedBox( // SizedBox(
// width: 300, // width: 300,
@@ -380,50 +377,38 @@ class _PrescripInputState extends State<PrescripInput> {
// ), // ),
// ), // ),
// const SizedBox(height: 10.0), // const SizedBox(height: 10.0),
SizedBox( MIHDropdownField(
width: 300,
child: MIHDropdownField(
controller: widget.dosageController, controller: widget.dosageController,
hintText: "Dosage", hintText: "Dosage",
dropdownOptions: numberOptions, dropdownOptions: numberOptions,
required: true, required: true,
editable: true, editable: true,
), ),
),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
SizedBox( MIHDropdownField(
width: 300,
child: MIHDropdownField(
controller: widget.timesDailyController, controller: widget.timesDailyController,
hintText: "Times Daily", hintText: "Times Daily",
dropdownOptions: numberOptions, dropdownOptions: numberOptions,
required: true, required: true,
editable: true, editable: true,
), ),
),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
SizedBox( MIHDropdownField(
width: 300,
child: MIHDropdownField(
controller: widget.noDaysController, controller: widget.noDaysController,
hintText: "No. Days", hintText: "No. Days",
dropdownOptions: numberOptions, dropdownOptions: numberOptions,
required: true, required: true,
editable: true, editable: true,
), ),
),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
SizedBox( MIHDropdownField(
width: 300,
child: MIHDropdownField(
controller: widget.noRepeatsController, controller: widget.noRepeatsController,
hintText: "No. Repeats", hintText: "No. Repeats",
dropdownOptions: numberOptions, dropdownOptions: numberOptions,
required: true, required: true,
editable: true, editable: true,
), ),
), const SizedBox(height: 15.0),
const SizedBox(height: 30.0),
SizedBox( SizedBox(
width: 300, width: 300,
height: 50, height: 50,
@@ -470,7 +455,7 @@ class _PrescripInputState extends State<PrescripInput> {
children: [ children: [
Container( Container(
width: 550, width: 550,
height: 350, height: 325,
decoration: BoxDecoration( decoration: BoxDecoration(
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
@@ -520,7 +505,7 @@ class _PrescripInputState extends State<PrescripInput> {
}, },
), ),
), ),
const SizedBox(height: 30.0), const SizedBox(height: 15.0),
SizedBox( SizedBox(
width: 300, width: 300,
height: 50, height: 50,
@@ -567,11 +552,7 @@ class _PrescripInputState extends State<PrescripInput> {
width = size.width; width = size.width;
height = size.height; height = size.height;
}); });
return Container( return Wrap(
//width: ,
height: (height / 3) * 1.5,
child: SingleChildScrollView(
child: Wrap(
direction: Axis.horizontal, direction: Axis.horizontal,
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
spacing: 10, spacing: 10,
@@ -580,11 +561,9 @@ class _PrescripInputState extends State<PrescripInput> {
// mainAxisSize: MainAxisSize.max, // mainAxisSize: MainAxisSize.max,
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
displayMedInput(), SizedBox(width: 500, child: displayMedInput()),
displayPerscList(), displayPerscList(),
], ],
),
),
); );
} }
} }