fix overflow issues

This commit is contained in:
2024-07-30 14:11:28 +02:00
parent 91e2f81692
commit 650a6a947a

View File

@@ -168,83 +168,57 @@ class _AddPatientState extends State<AddPatient> {
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
), ),
), ),
Row(
children: [
Expanded(
child: MyTextField(
controller: idController,
hintText: "13 digit ID Number or Passport",
editable: true,
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: true,
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(
children: [ MyTextField(
Expanded( controller: cellController,
child: MyTextField( hintText: "Cell Number",
controller: emailController, editable: true,
hintText: "Email", required: true,
editable: false,
required: true,
),
),
],
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
Row(
children: [ MyTextField(
Expanded( controller: emailController,
child: MyTextField( hintText: "Email",
controller: addressController, editable: false,
hintText: "Address", required: true,
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",
@@ -256,117 +230,86 @@ class _AddPatientState extends State<AddPatient> {
), ),
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
Row(
children: [ MyDropdownField(
Expanded( controller: medAidController,
child: MyDropdownField( hintText: "Medical Aid",
controller: medAidController, editable: true,
hintText: "Medical Aid", onSelect: (_) {
editable: true, isRequired();
onSelect: (_) { },
isRequired(); required: true,
}, dropdownOptions: const ["Yes", "No"],
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(
children: [ MyTextField(
Expanded( controller: medAidCodeController,
child: MyTextField( hintText: "Medical Aid Code",
controller: medAidCodeController, editable: medRequired,
hintText: "Medical Aid Code", required: medRequired,
editable: medRequired,
required: medRequired,
),
),
],
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
Row(
children: [ MyTextField(
Expanded( controller: medNameController,
child: MyTextField( hintText: "Medical Aid Name",
controller: medNameController, editable: medRequired,
hintText: "Medical Aid Name", required: medRequired,
editable: medRequired,
required: medRequired,
),
),
],
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
Row(
children: [ MyTextField(
Expanded( controller: medSchemeController,
child: MyTextField( hintText: "Medical Aid Scheme",
controller: medSchemeController, editable: medRequired,
hintText: "Medical Aid Scheme", required: medRequired,
editable: medRequired,
required: medRequired,
),
),
],
), ),
//const SizedBox(height: 10.0), //const SizedBox(height: 10.0),
Row(
mainAxisAlignment: MainAxisAlignment.center, SizedBox(
children: [ width: 450.0,
SizedBox( height: 100.0,
width: 450.0, child: MyButton(
height: 100.0, onTap: () {
child: MyButton( if (isFieldsFilled()) {
onTap: () { addPatientAPICall();
if (isFieldsFilled()) { } else {
addPatientAPICall(); showDialog(
} else { context: context,
showDialog( builder: (context) {
context: context, return const MyErrorMessage(errorType: "Input Error");
builder: (context) { },
return const MyErrorMessage( );
errorType: "Input Error"); }
}, },
); buttonText: "Add",
} buttonColor:
}, MzanziInnovationHub.of(context)!.theme.secondaryColor(),
buttonText: "Add", textColor:
buttonColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
MzanziInnovationHub.of(context)!.theme.secondaryColor(), ),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
),
),
],
), ),
], ],
), ),