fix pat man padding

This commit is contained in:
2025-06-06 13:15:47 +02:00
parent 2db045cc2e
commit 52bf4ed1b6
2 changed files with 303 additions and 276 deletions

View File

@@ -79,10 +79,9 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
}
}
void appointmentPopUp(int index) {
void appointmentPopUp(int index, double width) {
var firstLetterFName = widget.patientAccesses[index].fname;
var firstLetterLName = widget.patientAccesses[index].lname;
setState(() {
idController.text = widget.patientAccesses[index].id_no;
fnameController.text = firstLetterFName;
@@ -97,7 +96,12 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
onWindowTapClose: () {
Navigator.pop(context);
},
windowBody: Column(
windowBody: Padding(
padding:
MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.056)
: const EdgeInsets.symmetric(horizontal: 0),
child: Column(
children: [
MihForm(
formKey: _formKey,
@@ -177,8 +181,9 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
}
}
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
width: 300,
child: Text(
"Book Appointment",
@@ -197,6 +202,7 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
],
),
),
),
);
}
@@ -229,10 +235,10 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
return hasAccess;
}
void patientProfileChoicePopUp(int index, Patient? patientProfile) async {
void patientProfileChoicePopUp(
int index, Patient? patientProfile, double width) async {
var firstLetterFName = widget.patientAccesses[index].fname;
var firstLetterLName = widget.patientAccesses[index].lname;
setState(() {
idController.text = widget.patientAccesses[index].id_no;
fnameController.text = firstLetterFName;
@@ -247,12 +253,18 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
onWindowTapClose: () {
Navigator.pop(context);
},
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: [
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: idController,
multiLineInput: false,
requiredText: true,
@@ -266,7 +278,8 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: fnameController,
multiLineInput: false,
requiredText: true,
@@ -280,7 +293,8 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: lnameController,
multiLineInput: false,
requiredText: true,
@@ -298,10 +312,11 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
children: [
MihButton(
onPressed: () {
appointmentPopUp(index);
appointmentPopUp(index, width);
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
width: 300,
child: Text(
"Book Appointment",
@@ -346,10 +361,11 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
],
),
),
),
);
}
Widget displayMyPatientTile(int index) {
Widget displayMyPatientTile(int index, double width) {
var firstName = "";
var lastName = "";
String access = widget.patientAccesses[index].status.toUpperCase();
@@ -407,7 +423,7 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
p = result;
});
});
patientProfileChoicePopUp(index, p);
patientProfileChoicePopUp(index, p, width);
} else {
noAccessWarning(index);
}
@@ -431,6 +447,7 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
@@ -441,7 +458,7 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
},
itemCount: widget.patientAccesses.length,
itemBuilder: (context, index) {
return displayMyPatientTile(index);
return displayMyPatientTile(index, screenWidth);
},
);
}

View File

@@ -63,7 +63,7 @@ class _WaitingRoomState extends State<WaitingRoom> {
final _formKey = GlobalKey<FormState>();
// Business Appointment Tool
Widget getBusinessAppointmentsTool() {
Widget getBusinessAppointmentsTool(double width) {
return Stack(
children: [
MihSingleChildScroll(
@@ -139,7 +139,7 @@ class _WaitingRoomState extends State<WaitingRoom> {
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
// addAppointmentWindow();
appointmentTypeSelection();
appointmentTypeSelection(width);
},
)
],
@@ -205,7 +205,7 @@ class _WaitingRoomState extends State<WaitingRoom> {
);
}
void appointmentTypeSelection() {
void appointmentTypeSelection(double width) {
String question = "What type of appointment would you like to add?";
question +=
"\n\nExisting Patient: Add an appointment for an patient your practice has access to.";
@@ -276,7 +276,7 @@ class _WaitingRoomState extends State<WaitingRoom> {
MihButton(
onPressed: () {
Navigator.pop(context);
addAppointmentWindow();
addAppointmentWindow(width);
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
@@ -298,7 +298,7 @@ class _WaitingRoomState extends State<WaitingRoom> {
);
}
void addAppointmentWindow() {
void addAppointmentWindow(double width) {
showDialog(
context: context,
barrierDismissible: false,
@@ -314,14 +314,20 @@ class _WaitingRoomState extends State<WaitingRoom> {
_appointmentDescriptionIDController.clear();
_patientController.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,
formFields: [
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
fillColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: _appointmentTitleController,
@@ -353,8 +359,9 @@ class _WaitingRoomState extends State<WaitingRoom> {
const SizedBox(height: 10),
MihTextFormField(
height: 250,
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
fillColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: _appointmentDescriptionIDController,
@@ -373,8 +380,9 @@ class _WaitingRoomState extends State<WaitingRoom> {
addAppointmentCall();
}
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
buttonColor: MzanziInnovationHub.of(context)!
.theme
.successColor(),
width: 300,
child: Text(
"Add",
@@ -392,6 +400,7 @@ class _WaitingRoomState extends State<WaitingRoom> {
),
],
),
),
);
},
);
@@ -477,9 +486,10 @@ class _WaitingRoomState extends State<WaitingRoom> {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MihPackageToolBody(
borderOn: false,
bodyItem: getBusinessAppointmentsTool(),
bodyItem: getBusinessAppointmentsTool(screenWidth),
);
}
}