fix pat profile padding

This commit is contained in:
2025-06-06 13:39:54 +02:00
parent 52bf4ed1b6
commit 0cfe408bce
5 changed files with 1093 additions and 1103 deletions

View File

@@ -82,8 +82,12 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
);
}
Widget getWindowBody() {
return Column(
Widget getWindowBody(double width) {
return Padding(
padding: MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.05)
: const EdgeInsets.symmetric(horizontal: 0),
child: Column(
children: [
MihForm(
formKey: _formKey,
@@ -110,7 +114,8 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
),
),
Divider(
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor()),
const SizedBox(height: 10),
MIHDateField(
controller: _serviceDateController,
@@ -261,7 +266,8 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: _amountController,
multiLineInput: false,
requiredText: true,
@@ -285,12 +291,14 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
),
),
Divider(
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor()),
const SizedBox(height: 10),
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: _preauthNoController,
multiLineInput: false,
requiredText: false,
@@ -368,6 +376,7 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
],
),
],
),
);
}
@@ -459,19 +468,14 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MihPackageWindow(
fullscreen: false,
windowTitle: "Generate Claim/ Statement Document",
onWindowTapClose: () {
// medicineController.clear();
// quantityController.clear();
// dosageController.clear();
// timesDailyController.clear();
// noDaysController.clear();
// noRepeatsController.clear();
Navigator.pop(context);
},
windowBody: getWindowBody(),
windowBody: getWindowBody(screenWidth),
);
}
}

View File

@@ -69,7 +69,7 @@ class _PatientConsultationState extends State<PatientConsultation> {
}
}
void addNotePopUp() {
void addNotePopUp(double width) {
DateTime now = new DateTime.now();
DateTime date = new DateTime(now.year, now.month, now.day);
var title = "";
@@ -94,7 +94,12 @@ class _PatientConsultationState extends State<PatientConsultation> {
titleController.clear();
noteTextController.clear();
},
windowBody: Column(
windowBody: Padding(
padding:
MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.05)
: const EdgeInsets.symmetric(horizontal: 0),
child: Column(
children: [
MihForm(
formKey: _formKey,
@@ -166,7 +171,8 @@ class _PatientConsultationState extends State<PatientConsultation> {
SizedBox(
height: 15,
child: ValueListenableBuilder(
builder: (BuildContext context, int value, Widget? child) {
builder:
(BuildContext context, int value, Widget? child) {
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
@@ -206,8 +212,9 @@ class _PatientConsultationState extends State<PatientConsultation> {
child: Text(
"Add Note",
style: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -218,6 +225,7 @@ class _PatientConsultationState extends State<PatientConsultation> {
],
),
),
),
);
}
@@ -271,40 +279,6 @@ class _PatientConsultationState extends State<PatientConsultation> {
}
}
List<Widget> setIcons() {
if (widget.type == "personal") {
return [
Text(
"Consultation Notes",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
),
];
} else {
return [
Text(
"Consultation Notes",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
),
IconButton(
onPressed: () {
// addConsultationNotePopUp();
addNotePopUp();
},
icon: Icon(Icons.add,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
)
];
}
}
void successPopUp(String message) {
showDialog(
context: context,
@@ -349,13 +323,14 @@ class _PatientConsultationState extends State<PatientConsultation> {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MihPackageToolBody(
borderOn: false,
bodyItem: getBody(),
bodyItem: getBody(screenWidth),
);
}
Widget getBody() {
Widget getBody(double width) {
return Stack(
children: [
MihSingleChildScroll(
@@ -413,7 +388,7 @@ class _PatientConsultationState extends State<PatientConsultation> {
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
// addConsultationNotePopUp();
addNotePopUp();
addNotePopUp(width);
},
)
],

View File

@@ -39,7 +39,7 @@ class _PatientInfoState extends State<PatientInfo> {
final medMainMemController = TextEditingController();
final medAidCodeController = TextEditingController();
final _formKey = GlobalKey<FormState>();
double textFieldWidth = 400.0;
double textFieldWidth = 500;
late String medAid;
Widget getPatientDetailsField() {
@@ -48,9 +48,12 @@ class _PatientInfoState extends State<PatientInfo> {
spacing: 15,
runSpacing: 10,
children: [
MihTextFormField(
SizedBox(
width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
child: MihTextFormField(
// width: textFieldWidth,
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: idController,
multiLineInput: false,
@@ -61,9 +64,13 @@ class _PatientInfoState extends State<PatientInfo> {
// return MihValidationServices().isEmpty(value);
// },
),
MihTextFormField(
),
SizedBox(
width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
child: MihTextFormField(
// width: textFieldWidth,
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: fnameController,
multiLineInput: false,
@@ -71,9 +78,13 @@ class _PatientInfoState extends State<PatientInfo> {
readOnly: true,
hintText: "First Name",
),
MihTextFormField(
),
SizedBox(
width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
child: MihTextFormField(
// width: textFieldWidth,
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: lnameController,
multiLineInput: false,
@@ -81,9 +92,13 @@ class _PatientInfoState extends State<PatientInfo> {
hintText: "Surname",
readOnly: true,
),
MihTextFormField(
),
SizedBox(
width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
child: MihTextFormField(
// width: textFieldWidth,
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: cellController,
multiLineInput: false,
@@ -91,9 +106,13 @@ class _PatientInfoState extends State<PatientInfo> {
readOnly: true,
hintText: "Cell No.",
),
MihTextFormField(
),
SizedBox(
width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
child: MihTextFormField(
// width: textFieldWidth,
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: emailController,
multiLineInput: false,
@@ -101,10 +120,14 @@ class _PatientInfoState extends State<PatientInfo> {
readOnly: true,
hintText: "Email",
),
MihTextFormField(
),
SizedBox(
width: textFieldWidth,
child: MihTextFormField(
// width: textFieldWidth,
height: 100,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: addressController,
multiLineInput: true,
@@ -112,6 +135,7 @@ class _PatientInfoState extends State<PatientInfo> {
readOnly: true,
hintText: "Address",
),
),
],
),
);
@@ -120,8 +144,10 @@ class _PatientInfoState extends State<PatientInfo> {
Widget getMedAidDetailsFields() {
List<Widget> medAidDet = [];
medAidDet.add(
MihTextFormField(
SizedBox(
width: textFieldWidth,
child: MihTextFormField(
// width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: medAidController,
@@ -130,6 +156,7 @@ class _PatientInfoState extends State<PatientInfo> {
readOnly: true,
hintText: "Medical Aid",
),
),
);
bool req;
if (medAid == "Yes") {
@@ -140,8 +167,10 @@ class _PatientInfoState extends State<PatientInfo> {
medAidDet.addAll([
Visibility(
visible: req,
child: MihTextFormField(
child: SizedBox(
width: textFieldWidth,
child: MihTextFormField(
// width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: medMainMemController,
@@ -151,10 +180,13 @@ class _PatientInfoState extends State<PatientInfo> {
hintText: "Main Member",
),
),
),
Visibility(
visible: req,
child: MihTextFormField(
child: SizedBox(
width: textFieldWidth,
child: MihTextFormField(
// width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: medNoController,
@@ -164,10 +196,13 @@ class _PatientInfoState extends State<PatientInfo> {
hintText: "No.",
),
),
),
Visibility(
visible: req,
child: MihTextFormField(
child: SizedBox(
width: textFieldWidth,
child: MihTextFormField(
// width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: medAidCodeController,
@@ -177,10 +212,12 @@ class _PatientInfoState extends State<PatientInfo> {
hintText: "Code",
),
),
),
Visibility(
visible: req,
child: SizedBox(
child: MihTextFormField(
width: textFieldWidth,
// width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: medNameController,
@@ -190,10 +227,13 @@ class _PatientInfoState extends State<PatientInfo> {
hintText: "Name",
),
),
),
Visibility(
visible: req,
child: MihTextFormField(
child: SizedBox(
width: textFieldWidth,
child: MihTextFormField(
// width: textFieldWidth,
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: medSchemeController,
@@ -203,6 +243,7 @@ class _PatientInfoState extends State<PatientInfo> {
hintText: "Plan",
),
),
),
]);
return Center(
child: Wrap(
@@ -263,14 +304,15 @@ class _PatientInfoState extends State<PatientInfo> {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MihPackageToolBody(
borderOn: false,
innerHorizontalPadding: 10,
bodyItem: getBody(),
bodyItem: getBody(screenWidth),
);
}
Widget getBody() {
Widget getBody(double width) {
return Stack(
children: [
MihSingleChildScroll(

View File

@@ -160,8 +160,12 @@ class _AddPatientState extends State<AddPatient> {
}
}
Widget displayForm() {
Widget displayForm(double width) {
return SingleChildScrollView(
child: Padding(
padding: MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.2)
: EdgeInsets.symmetric(horizontal: width * 0.075),
child: Column(
children: [
MihForm(
@@ -184,8 +188,9 @@ class _AddPatientState extends State<AddPatient> {
],
),
Divider(
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor()),
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor()),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor:
@@ -280,14 +285,16 @@ class _AddPatientState extends State<AddPatient> {
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25.0,
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
),
Divider(
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor()),
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor()),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: medAidController,
@@ -413,8 +420,9 @@ class _AddPatientState extends State<AddPatient> {
child: Text(
"Add",
style: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -426,6 +434,7 @@ class _AddPatientState extends State<AddPatient> {
),
],
),
),
);
}
@@ -458,7 +467,7 @@ class _AddPatientState extends State<AddPatient> {
);
}
MIHBody getBody() {
MIHBody getBody(double width) {
return MIHBody(
borderOn: false,
bodyItems: [
@@ -473,7 +482,7 @@ class _AddPatientState extends State<AddPatient> {
}
}
},
child: displayForm(),
child: displayForm(width),
),
],
);
@@ -513,12 +522,12 @@ class _AddPatientState extends State<AddPatient> {
@override
Widget build(BuildContext context) {
print("Add Patient");
double screenWidth = MediaQuery.of(context).size.width;
return MIHLayoutBuilder(
actionButton: getActionButton(),
header: getHeader(),
secondaryActionButton: null,
body: getBody(),
body: getBody(screenWidth),
actionDrawer: null,
secondaryActionDrawer: null,
bottomNavBar: null,

View File

@@ -374,8 +374,12 @@ class _EditPatientState extends State<EditPatient> {
}
}
Widget displayForm() {
Widget displayForm(double width) {
return SingleChildScrollView(
child: Padding(
padding: MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.2)
: EdgeInsets.symmetric(horizontal: width * 0.075),
child: Column(
children: [
MihForm(
@@ -398,8 +402,9 @@ class _EditPatientState extends State<EditPatient> {
],
),
Divider(
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor()),
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor()),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor:
@@ -494,14 +499,16 @@ class _EditPatientState extends State<EditPatient> {
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25.0,
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
),
Divider(
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor()),
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor()),
const SizedBox(height: 10.0),
MIHDropdownField(
controller: medAidController,
@@ -627,8 +634,9 @@ class _EditPatientState extends State<EditPatient> {
child: Text(
"Update",
style: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -640,6 +648,7 @@ class _EditPatientState extends State<EditPatient> {
),
],
),
),
);
}
@@ -672,7 +681,7 @@ class _EditPatientState extends State<EditPatient> {
);
}
MIHBody getBody() {
MIHBody getBody(double width) {
return MIHBody(
borderOn: false,
bodyItems: [
@@ -687,7 +696,7 @@ class _EditPatientState extends State<EditPatient> {
}
}
},
child: displayForm(),
child: displayForm(width),
),
],
);
@@ -747,61 +756,12 @@ class _EditPatientState extends State<EditPatient> {
actionButton: getActionButton(),
header: getHeader(),
secondaryActionButton: null,
body: getBody(),
body: getBody(width),
actionDrawer: null,
secondaryActionDrawer: null,
bottomNavBar: null,
pullDownToRefresh: false,
onPullDown: () async {},
);
// return Scaffold(
// // appBar: const MIHAppBar(
// // barTitle: "Edit Patient",
// // propicFile: null,
// // ),
// body: SafeArea(
// child: Stack(
// children: [
// KeyboardListener(
// focusNode: _focusNode,
// autofocus: true,
// onKeyEvent: (event) async {
// if (event is KeyDownEvent &&
// event.logicalKey == LogicalKeyboardKey.enter) {
// submitForm();
// }
// },
// child: displayForm(),
// ),
// Positioned(
// top: 10,
// left: 5,
// width: 50,
// height: 50,
// child: IconButton(
// onPressed: () {
// Navigator.of(context).pop();
// },
// icon: const Icon(Icons.arrow_back),
// ),
// ),
// Positioned(
// top: 10,
// right: 5,
// width: 50,
// height: 50,
// child: IconButton(
// icon: const Icon(Icons.delete),
// color:
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
// //alignment: Alignment.topRight,
// onPressed: () {
// deletePatientPopUp();
// },
// ))
// ],
// ),
// ),
// );
}
}