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