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,81 +344,34 @@ 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: [
), PrescripInput(
child: SingleChildScrollView( medicineController: medicineController,
padding: const EdgeInsets.symmetric(horizontal: 10), quantityController: quantityController,
child: Column( dosageController: dosageController,
crossAxisAlignment: CrossAxisAlignment.center, timesDailyController: timesDailyController,
mainAxisAlignment: MainAxisAlignment.center, noDaysController: noDaysController,
mainAxisSize: MainAxisSize.min, noRepeatsController: noRepeatsController,
children: [ outputController: outputController,
Text( selectedPatient: widget.selectedPatient,
"Create Perscription", signedInUser: widget.signedInUser,
textAlign: TextAlign.center, business: widget.business,
style: TextStyle( businessUser: widget.businessUser,
color: MzanziInnovationHub.of(context)! ),
.theme ],
.secondaryColor(),
fontSize: 35.0,
fontWeight: FontWeight.bold,
),
),
//const SizedBox(height: 25.0),
PrescripInput(
medicineController: medicineController,
quantityController: quantityController,
dosageController: dosageController,
timesDailyController: timesDailyController,
noDaysController: noDaysController,
noRepeatsController: noRepeatsController,
outputController: outputController,
selectedPatient: widget.selectedPatient,
signedInUser: widget.signedInUser,
business: widget.business,
businessUser: widget.businessUser,
),
],
),
),
),
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,17 +355,14 @@ class _PrescripInputState extends State<PrescripInput> {
getMedsPopUp(widget.medicineController); getMedsPopUp(widget.medicineController);
} }
}, },
child: SizedBox( child: MIHSearchField(
width: 300, controller: widget.medicineController,
child: MIHSearchField( hintText: "Medicine",
controller: widget.medicineController, required: true,
hintText: "Medicine", editable: true,
required: true, onTap: () {
editable: true, getMedsPopUp(widget.medicineController);
onTap: () { },
getMedsPopUp(widget.medicineController);
},
),
), ),
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
@@ -380,50 +377,38 @@ class _PrescripInputState extends State<PrescripInput> {
// ), // ),
// ), // ),
// const SizedBox(height: 10.0), // const SizedBox(height: 10.0),
SizedBox( MIHDropdownField(
width: 300, controller: widget.dosageController,
child: MIHDropdownField( hintText: "Dosage",
controller: widget.dosageController, dropdownOptions: numberOptions,
hintText: "Dosage", required: true,
dropdownOptions: numberOptions, editable: true,
required: true,
editable: true,
),
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
SizedBox( MIHDropdownField(
width: 300, controller: widget.timesDailyController,
child: MIHDropdownField( hintText: "Times Daily",
controller: widget.timesDailyController, dropdownOptions: numberOptions,
hintText: "Times Daily", required: true,
dropdownOptions: numberOptions, editable: true,
required: true,
editable: true,
),
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
SizedBox( MIHDropdownField(
width: 300, controller: widget.noDaysController,
child: MIHDropdownField( hintText: "No. Days",
controller: widget.noDaysController, dropdownOptions: numberOptions,
hintText: "No. Days", required: true,
dropdownOptions: numberOptions, editable: true,
required: true,
editable: true,
),
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
SizedBox( MIHDropdownField(
width: 300, controller: widget.noRepeatsController,
child: MIHDropdownField( hintText: "No. Repeats",
controller: widget.noRepeatsController, dropdownOptions: numberOptions,
hintText: "No. Repeats", required: true,
dropdownOptions: numberOptions, editable: true,
required: true,
editable: true,
),
), ),
const SizedBox(height: 30.0), const SizedBox(height: 15.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,24 +552,18 @@ class _PrescripInputState extends State<PrescripInput> {
width = size.width; width = size.width;
height = size.height; height = size.height;
}); });
return Container( return Wrap(
//width: , direction: Axis.horizontal,
height: (height / 3) * 1.5, alignment: WrapAlignment.center,
child: SingleChildScrollView( spacing: 10,
child: Wrap( runSpacing: 10,
direction: Axis.horizontal, // mainAxisAlignment: MainAxisAlignment.center,
alignment: WrapAlignment.center, // mainAxisSize: MainAxisSize.max,
spacing: 10, // crossAxisAlignment: CrossAxisAlignment.center,
runSpacing: 10, children: [
// mainAxisAlignment: MainAxisAlignment.center, SizedBox(width: 500, child: displayMedInput()),
// mainAxisSize: MainAxisSize.max, displayPerscList(),
// crossAxisAlignment: CrossAxisAlignment.center, ],
children: [
displayMedInput(),
displayPerscList(),
],
),
),
); );
} }
} }