textfields no wrap when screen changes size

This commit is contained in:
2024-07-30 10:56:42 +02:00
parent 115c466302
commit beba15afdb
2 changed files with 103 additions and 104 deletions

View File

@@ -26,6 +26,7 @@ class _PatientDetailsState extends State<PatientDetails> {
final medAidCodeController = TextEditingController(); final medAidCodeController = TextEditingController();
double? headingFontSize = 35.0; double? headingFontSize = 35.0;
double? bodyFonstSize = 20.0; double? bodyFonstSize = 20.0;
double textFieldWidth = 400.0;
@override @override
void initState() { void initState() {
@@ -60,7 +61,7 @@ class _PatientDetailsState extends State<PatientDetails> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 10), padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
@@ -100,51 +101,52 @@ class _PatientDetailsState extends State<PatientDetails> {
Divider( Divider(
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
const SizedBox(height: 10), const SizedBox(height: 10),
Column( Wrap(
spacing: 15,
runSpacing: 10,
children: [ children: [
Row( SizedBox(
children: [ width: textFieldWidth,
Expanded(
child: MyTextField( child: MyTextField(
controller: idController, controller: idController,
hintText: "ID No.", hintText: "ID No.",
editable: false, editable: false,
required: false), required: false),
), ),
Expanded( SizedBox(
width: textFieldWidth,
child: MyTextField( child: MyTextField(
controller: fnameController, controller: fnameController,
hintText: "Name", hintText: "Name",
editable: false, editable: false,
required: false), required: false),
), ),
Expanded( SizedBox(
width: textFieldWidth,
child: MyTextField( child: MyTextField(
controller: lnameController, controller: lnameController,
hintText: "Surname", hintText: "Surname",
editable: false, editable: false,
required: false), required: false),
), ),
], SizedBox(
), width: textFieldWidth,
const SizedBox(height: 10),
Row(
children: [
Expanded(
child: MyTextField( child: MyTextField(
controller: cellController, controller: cellController,
hintText: "Cell No.", hintText: "Cell No.",
editable: false, editable: false,
required: false), required: false),
), ),
Expanded( SizedBox(
width: textFieldWidth,
child: MyTextField( child: MyTextField(
controller: emailController, controller: emailController,
hintText: "Email", hintText: "Email",
editable: false, editable: false,
required: false), required: false),
), ),
Expanded( SizedBox(
width: textFieldWidth,
child: MyTextField( child: MyTextField(
controller: addressController, controller: addressController,
hintText: "Address", hintText: "Address",
@@ -153,8 +155,6 @@ class _PatientDetailsState extends State<PatientDetails> {
), ),
], ],
), ),
],
),
const SizedBox(height: 10), const SizedBox(height: 10),
Text( Text(
"Medical Aid Details", "Medical Aid Details",
@@ -168,51 +168,52 @@ class _PatientDetailsState extends State<PatientDetails> {
Divider( Divider(
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
const SizedBox(height: 10), const SizedBox(height: 10),
Column( Wrap(
spacing: 10,
runSpacing: 10,
children: [ children: [
Row( SizedBox(
children: [ width: textFieldWidth,
Expanded(
child: MyTextField( child: MyTextField(
controller: medAidController, controller: medAidController,
hintText: "Has Medical Aid", hintText: "Has Medical Aid",
editable: false, editable: false,
required: false), required: false),
), ),
Expanded( SizedBox(
width: textFieldWidth,
child: MyTextField( child: MyTextField(
controller: medMainMemController, controller: medMainMemController,
hintText: "Main Member", hintText: "Main Member",
editable: false, editable: false,
required: false), required: false),
), ),
Expanded( SizedBox(
width: textFieldWidth,
child: MyTextField( child: MyTextField(
controller: medNoController, controller: medNoController,
hintText: "No.", hintText: "No.",
editable: false, editable: false,
required: false), required: false),
), ),
], SizedBox(
), width: textFieldWidth,
const SizedBox(height: 10),
Row(
children: [
Expanded(
child: MyTextField( child: MyTextField(
controller: medAidCodeController, controller: medAidCodeController,
hintText: "Code", hintText: "Code",
editable: false, editable: false,
required: false), required: false),
), ),
Expanded( SizedBox(
width: textFieldWidth,
child: MyTextField( child: MyTextField(
controller: medNameController, controller: medNameController,
hintText: "Name", hintText: "Name",
editable: false, editable: false,
required: false), required: false),
), ),
Expanded( SizedBox(
width: textFieldWidth,
child: MyTextField( child: MyTextField(
controller: medSchemeController, controller: medSchemeController,
hintText: "Scheme", hintText: "Scheme",
@@ -222,8 +223,6 @@ class _PatientDetailsState extends State<PatientDetails> {
], ],
), ),
], ],
)
],
), ),
); );
} }

View File

@@ -91,14 +91,14 @@ class _PatientViewState extends State<PatientView> {
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: [ children: [
SizedBox( SizedBox(
width: 650, width: 660,
child: PatientNotes( child: PatientNotes(
patientAppId: snapshot.data!.app_id, patientAppId: snapshot.data!.app_id,
signedInUser: widget.signedInUser, signedInUser: widget.signedInUser,
), ),
), ),
SizedBox( SizedBox(
width: 650, width: 660,
child: PatientFiles( child: PatientFiles(
patientIndex: snapshot.data!.idpatients, patientIndex: snapshot.data!.idpatients,
selectedPatient: snapshot.data!, selectedPatient: snapshot.data!,