fix overflow issues

This commit is contained in:
2024-07-30 11:17:52 +02:00
parent 46ee99d903
commit f18d485fda

View File

@@ -380,83 +380,54 @@ class _EditPatientState extends State<EditPatient> {
)
],
),
Row(
children: [
Expanded(
child: MyTextField(
controller: idController,
hintText: "13 digit ID Number or Passport",
editable: false,
required: true,
),
),
],
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: MyTextField(
controller: fnameController,
hintText: "First Name",
editable: false,
required: true,
),
),
],
MyTextField(
controller: idController,
hintText: "13 digit ID Number or Passport",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: MyTextField(
controller: lnameController,
hintText: "Last Name",
editable: false,
required: true,
),
),
],
MyTextField(
controller: fnameController,
hintText: "First Name",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: MyTextField(
controller: cellController,
hintText: "Cell Number",
editable: true,
required: true,
),
),
],
MyTextField(
controller: lnameController,
hintText: "Last Name",
editable: false,
required: true,
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: MyTextField(
controller: emailController,
hintText: "Email",
editable: false,
required: true,
),
),
],
MyTextField(
controller: cellController,
hintText: "Cell Number",
editable: true,
required: true,
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: MyTextField(
controller: addressController,
hintText: "Address",
editable: true,
required: true,
),
),
],
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",
@@ -468,125 +439,89 @@ class _EditPatientState extends State<EditPatient> {
),
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: 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"],
),
),
],
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"],
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: MyDropdownField(
controller: medMainMemController,
hintText: "Main Member.",
editable: medRequired,
required: medRequired,
dropdownOptions: const ["Yes", "No"],
),
),
],
MyDropdownField(
controller: medMainMemController,
hintText: "Main Member.",
editable: medRequired,
required: medRequired,
dropdownOptions: const ["Yes", "No"],
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: MyTextField(
controller: medNoController,
hintText: "Medical Aid No.",
editable: medRequired,
required: medRequired,
),
),
],
MyTextField(
controller: medNoController,
hintText: "Medical Aid No.",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: MyTextField(
controller: medAidCodeController,
hintText: "Medical Aid Code",
editable: medRequired,
required: medRequired,
),
),
],
MyTextField(
controller: medAidCodeController,
hintText: "Medical Aid Code",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: MyTextField(
controller: medNameController,
hintText: "Medical Aid Name",
editable: medRequired,
required: medRequired,
),
),
],
MyTextField(
controller: medNameController,
hintText: "Medical Aid Name",
editable: medRequired,
required: medRequired,
),
const SizedBox(height: 10.0),
Row(
children: [
Expanded(
child: MyTextField(
controller: medSchemeController,
hintText: "Medical Aid Scheme",
editable: medRequired,
required: medRequired,
),
),
],
MyTextField(
controller: medSchemeController,
hintText: "Medical Aid Scheme",
editable: medRequired,
required: medRequired,
),
//const SizedBox(height: 10.0),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 450.0,
height: 100.0,
child: MyButton(
onTap: () {
if (isFieldsFilled()) {
updatePatientApiCall();
} else {
showDialog(
context: context,
builder: (context) {
return const MyErrorMessage(
errorType: "Input Error");
},
);
}
},
buttonText: "Update",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
),
],
SizedBox(
width: 500.0,
height: 100.0,
child: MyButton(
onTap: () {
if (isFieldsFilled()) {
updatePatientApiCall();
} else {
showDialog(
context: context,
builder: (context) {
return const MyErrorMessage(errorType: "Input Error");
},
);
}
},
buttonText: "Update",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
),
],
),