Fix pop up windows with input. make more dynamic

This commit is contained in:
2024-09-19 10:56:57 +02:00
parent 7f2367a9ce
commit 7111ad3600
10 changed files with 271 additions and 230 deletions

View File

@@ -144,7 +144,7 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0),
),
child: Padding(
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column(
mainAxisSize: MainAxisSize.min,

View File

@@ -263,54 +263,58 @@ class _PatientFilesState extends State<PatientFiles> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0),
),
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,
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");
},
);
}
},
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(
@@ -354,37 +358,40 @@ class _PatientFilesState extends State<PatientFiles> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0),
),
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,
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,
),
],
//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(

View File

@@ -158,97 +158,103 @@ class _PatientNotesState extends State<PatientNotes> {
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 5.0),
),
child: Column(
//mainAxisSize: MainAxisSize.max,
children: [
Text(
"Add Note",
textAlign: TextAlign.center,
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
fontSize: 35.0,
fontWeight: FontWeight.bold,
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
"Add Note",
textAlign: TextAlign.center,
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
fontSize: 35.0,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 25.0),
SizedBox(
width: 700,
child: MIHTextField(
controller: officeController,
hintText: "Office",
editable: false,
required: true,
const SizedBox(height: 25.0),
SizedBox(
width: 700,
child: MIHTextField(
controller: officeController,
hintText: "Office",
editable: false,
required: true,
),
),
),
const SizedBox(height: 10.0),
SizedBox(
width: 700,
child: MIHTextField(
controller: doctorController,
hintText: "Created By",
editable: false,
required: true,
const SizedBox(height: 10.0),
SizedBox(
width: 700,
child: MIHTextField(
controller: doctorController,
hintText: "Created By",
editable: false,
required: true,
),
),
),
const SizedBox(height: 10.0),
SizedBox(
width: 700,
child: MIHTextField(
controller: dateController,
hintText: "Created Date",
editable: false,
required: true,
const SizedBox(height: 10.0),
SizedBox(
width: 700,
child: MIHTextField(
controller: dateController,
hintText: "Created Date",
editable: false,
required: true,
),
),
),
const SizedBox(height: 10.0),
SizedBox(
width: 700,
child: MIHTextField(
controller: titleController,
hintText: "Note Title",
editable: true,
required: true,
const SizedBox(height: 10.0),
SizedBox(
width: 700,
child: MIHTextField(
controller: titleController,
hintText: "Note Title",
editable: true,
required: true,
),
),
),
const SizedBox(height: 10.0),
Expanded(
child: MIHMLTextField(
controller: noteTextController,
hintText: "Note Details",
editable: true,
required: true,
const SizedBox(height: 10.0),
SizedBox(
width: 700,
height: 250,
child: MIHMLTextField(
controller: noteTextController,
hintText: "Note Details",
editable: true,
required: true,
),
),
),
const SizedBox(height: 30.0),
SizedBox(
width: 300,
height: 50,
child: MIHButton(
onTap: () {
if (isFieldsFilled()) {
addPatientNoteAPICall();
Navigator.pop(context);
} else {
showDialog(
context: context,
builder: (context) {
return const MIHErrorMessage(
errorType: "Input Error");
},
);
}
},
buttonText: "Add Note",
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
)
],
const SizedBox(height: 30.0),
SizedBox(
width: 300,
height: 50,
child: MIHButton(
onTap: () {
if (isFieldsFilled()) {
addPatientNoteAPICall();
Navigator.pop(context);
} else {
showDialog(
context: context,
builder: (context) {
return const MIHErrorMessage(
errorType: "Input Error");
},
);
}
},
buttonText: "Add Note",
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
textColor: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
),
)
],
),
),
),
Positioned(

View File

@@ -344,6 +344,8 @@ class _PrescripInputState extends State<PrescripInput> {
Widget displayMedInput() {
return Column(
children: [
const SizedBox(height: 25.0),
KeyboardListener(
focusNode: _focusNode,
autofocus: true,