fix scrolling overlay

This commit is contained in:
2024-08-08 11:42:53 +02:00
parent ab7c9209ac
commit 0509b826a7
2 changed files with 294 additions and 301 deletions

View File

@@ -156,155 +156,152 @@ class _AddPatientState extends State<AddPatient> {
} }
Widget displayForm() { Widget displayForm() {
return Padding( return SingleChildScrollView(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(25.0),
child: SingleChildScrollView( child: Column(
child: Column( children: [
children: [ Text(
Text( "Personal Details",
"Personal Details", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(
style: TextStyle( fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, fontSize: 25.0,
fontSize: 25.0, color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
), ),
const SizedBox(height: 10.0), ),
MyTextField( const SizedBox(height: 10.0),
controller: idController, MyTextField(
hintText: "13 digit ID Number or Passport", controller: idController,
editable: true, hintText: "13 digit ID Number or Passport",
required: true, editable: true,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: fnameController,
hintText: "First Name",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: lnameController,
hintText: "Last Name",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: cellController,
hintText: "Cell Number",
editable: true,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: emailController,
hintText: "Email",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: addressController,
hintText: "Address",
editable: true,
required: true,
),
const SizedBox(height: 15.0),
Text(
"Medical Aid Details",
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25.0,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
), ),
),
const SizedBox(height: 10.0),
const SizedBox(height: 10.0), MyDropdownField(
MyTextField( controller: medAidController,
controller: fnameController, hintText: "Medical Aid",
hintText: "First Name", editable: true,
editable: false, onSelect: (_) {
required: true, isRequired();
},
required: true,
dropdownOptions: const ["Yes", "No"],
),
Visibility(
visible: medRequired,
child: Column(
children: [
const SizedBox(height: 10.0),
MyDropdownField(
controller: medMainMemController,
hintText: "Main Member",
editable: medRequired,
required: medRequired,
dropdownOptions: const ["Yes", "No"],
),
const SizedBox(height: 10.0),
MyTextField(
controller: medNoController,
hintText: "Medical Aid No.",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medAidCodeController,
hintText: "Medical Aid Code",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medNameController,
hintText: "Medical Aid Name",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medSchemeController,
hintText: "Medical Aid Scheme",
editable: medRequired,
required: medRequired,
),
],
), ),
),
const SizedBox(height: 10.0), //const SizedBox(height: 10.0),
MyTextField(
controller: lnameController,
hintText: "Last Name",
editable: false,
required: true,
),
const SizedBox(height: 10.0), SizedBox(
width: 450.0,
MyTextField( height: 100.0,
controller: cellController, child: MyButton(
hintText: "Cell Number", onTap: () {
editable: true, submitForm();
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: emailController,
hintText: "Email",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: addressController,
hintText: "Address",
editable: true,
required: true,
),
const SizedBox(height: 15.0),
Text(
"Medical Aid Details",
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25.0,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10.0),
MyDropdownField(
controller: medAidController,
hintText: "Medical Aid",
editable: true,
onSelect: (_) {
isRequired();
}, },
required: true, buttonText: "Add",
dropdownOptions: const ["Yes", "No"], buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
), ),
Visibility( ),
visible: medRequired, ],
child: Column(
children: [
const SizedBox(height: 10.0),
MyDropdownField(
controller: medMainMemController,
hintText: "Main Member",
editable: medRequired,
required: medRequired,
dropdownOptions: const ["Yes", "No"],
),
const SizedBox(height: 10.0),
MyTextField(
controller: medNoController,
hintText: "Medical Aid No.",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medAidCodeController,
hintText: "Medical Aid Code",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medNameController,
hintText: "Medical Aid Name",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medSchemeController,
hintText: "Medical Aid Scheme",
editable: medRequired,
required: medRequired,
),
],
),
),
//const SizedBox(height: 10.0),
SizedBox(
width: 450.0,
height: 100.0,
child: MyButton(
onTap: () {
submitForm();
},
buttonText: "Add",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
),
],
),
), ),
); );
} }

View File

@@ -354,173 +354,169 @@ class _EditPatientState extends State<EditPatient> {
} }
Widget displayForm() { Widget displayForm() {
return Padding( return SingleChildScrollView(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(25.0),
child: SingleChildScrollView( child: Column(
child: Column( children: [
children: [ Row(
Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [ Text(
Text( "Personal Details",
"Personal Details", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(
style: TextStyle( fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, fontSize: 25.0,
fontSize: 25.0,
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
IconButton(
icon: const Icon(Icons.delete),
color: color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
alignment: Alignment.topRight, ),
onPressed: () { ),
deletePatientPopUp(); IconButton(
}, icon: const Icon(Icons.delete),
) color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
alignment: Alignment.topRight,
onPressed: () {
deletePatientPopUp();
},
)
],
),
const SizedBox(height: 10.0),
MyTextField(
controller: idController,
hintText: "13 digit ID Number or Passport",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: fnameController,
hintText: "First Name",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: lnameController,
hintText: "Last Name",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: cellController,
hintText: "Cell Number",
editable: true,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: emailController,
hintText: "Email",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: addressController,
hintText: "Address",
editable: true,
required: true,
),
const SizedBox(height: 15.0),
Text(
"Medical Aid Details",
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25.0,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10.0),
MyDropdownField(
controller: medAidController,
hintText: "Medical Aid",
onSelect: (selected) {
if (selected == "Yes") {
setState(() {
medRequired = true;
});
} else {
setState(() {
medRequired = false;
});
}
},
editable: true,
required: true,
dropdownOptions: const ["Yes", "No"],
),
Visibility(
visible: medRequired,
child: Column(
children: [
const SizedBox(height: 10.0),
MyDropdownField(
controller: medMainMemController,
hintText: "Main Member.",
editable: medRequired,
required: medRequired,
dropdownOptions: const ["Yes", "No"],
),
const SizedBox(height: 10.0),
MyTextField(
controller: medNoController,
hintText: "Medical Aid No.",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medAidCodeController,
hintText: "Medical Aid Code",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medNameController,
hintText: "Medical Aid Name",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medSchemeController,
hintText: "Medical Aid Scheme",
editable: medRequired,
required: medRequired,
),
], ],
), ),
const SizedBox(height: 10.0), ),
MyTextField(
controller: idController,
hintText: "13 digit ID Number or Passport",
editable: false,
required: true,
),
const SizedBox(height: 10.0), //const SizedBox(height: 10.0),
MyTextField( SizedBox(
controller: fnameController, width: 500.0,
hintText: "First Name", height: 100.0,
editable: false, child: MyButton(
required: true, onTap: () {
), submitForm();
const SizedBox(height: 10.0),
MyTextField(
controller: lnameController,
hintText: "Last Name",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: cellController,
hintText: "Cell Number",
editable: true,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: emailController,
hintText: "Email",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
MyTextField(
controller: addressController,
hintText: "Address",
editable: true,
required: true,
),
const SizedBox(height: 15.0),
Text(
"Medical Aid Details",
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25.0,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10.0),
MyDropdownField(
controller: medAidController,
hintText: "Medical Aid",
onSelect: (selected) {
if (selected == "Yes") {
setState(() {
medRequired = true;
});
} else {
setState(() {
medRequired = false;
});
}
}, },
editable: true, buttonText: "Update",
required: true, buttonColor:
dropdownOptions: const ["Yes", "No"], MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
), ),
Visibility( ),
visible: medRequired, ],
child: Column(
children: [
const SizedBox(height: 10.0),
MyDropdownField(
controller: medMainMemController,
hintText: "Main Member.",
editable: medRequired,
required: medRequired,
dropdownOptions: const ["Yes", "No"],
),
const SizedBox(height: 10.0),
MyTextField(
controller: medNoController,
hintText: "Medical Aid No.",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medAidCodeController,
hintText: "Medical Aid Code",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medNameController,
hintText: "Medical Aid Name",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
MyTextField(
controller: medSchemeController,
hintText: "Medical Aid Scheme",
editable: medRequired,
required: medRequired,
),
],
),
),
//const SizedBox(height: 10.0),
SizedBox(
width: 500.0,
height: 100.0,
child: MyButton(
onTap: () {
submitForm();
},
buttonText: "Update",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
),
],
),
), ),
); );
} }