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(
context: context,
barrierDismissible: false,
builder: (context) => Dialog(
child: Stack(
children: [
Container(
padding: const EdgeInsets.all(10.0),
width: 900.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(
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(
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,
),
),
),
],
),
builder: (context) => MIHWindow(
fullscreen: false,
windowTitle: "Create Prescription",
windowTools: const [],
onWindowTapClose: () {
medicineController.clear();
quantityController.clear();
dosageController.clear();
timesDailyController.clear();
noDaysController.clear();
noRepeatsController.clear();
Navigator.pop(context);
},
windowBody: [
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,
),
],
),
);
}

View File

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