fix appointment padding and install button

This commit is contained in:
2025-06-06 12:09:26 +02:00
parent 704b50b528
commit efce3ded64
2 changed files with 346 additions and 320 deletions

View File

@@ -71,7 +71,7 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
}
}
Widget displayAppointment(int index) {
Widget displayAppointment(int index, double bodyWidth) {
String heading =
"${widget.appointmentList[index].date_time.split('T')[1].substring(0, 5)} - ${widget.appointmentList[index].title.toUpperCase()}";
String description = widget.appointmentList[index].description;
@@ -102,9 +102,7 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
MzanziInnovationHub.of(context)!.theme.messageTextColor();
}
return Padding(
padding: const EdgeInsets.all(5.0),
child: Container(
return Container(
decoration: BoxDecoration(
border: Border.all(
width: 3.0,
@@ -133,23 +131,21 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
widget.appointmentList[index].description;
widget.dateController.text =
widget.appointmentList[index].date_time.split('T')[0];
widget.timeController.text = widget
.appointmentList[index].date_time
widget.timeController.text = widget.appointmentList[index].date_time
.split('T')[1]
.substring(0, 5);
});
if (widget.inWaitingRoom == false) {
appointmentDetailsWindow(index);
appointmentDetailsWindow(index, bodyWidth);
} else {
waitingRiinAppointmentDetailsWindow(index);
waitingRiinAppointmentDetailsWindow(index, bodyWidth);
}
},
),
),
);
}
void appointmentDetailsWindow(int index) {
void appointmentDetailsWindow(int index, double bodyWidth) {
showDialog(
context: context,
barrierDismissible: false,
@@ -173,7 +169,7 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
appointmentUpdateWindow(index);
appointmentUpdateWindow(index, bodyWidth);
},
),
SpeedDialChild(
@@ -202,7 +198,12 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
widget.titleController.clear();
widget.descriptionIDController.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: [
const SizedBox(height: 10),
MihTextFormField(
@@ -256,12 +257,13 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
const SizedBox(height: 10),
],
),
),
);
},
);
}
void waitingRiinAppointmentDetailsWindow(int index) {
void waitingRiinAppointmentDetailsWindow(int index, double bodyWidth) {
showDialog(
context: context,
barrierDismissible: false,
@@ -285,7 +287,7 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
appointmentUpdateWindow(index);
appointmentUpdateWindow(index, bodyWidth);
},
),
SpeedDialChild(
@@ -314,7 +316,12 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
widget.titleController.clear();
widget.descriptionIDController.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: [
const SizedBox(height: 10),
MihTextFormField(
@@ -378,12 +385,13 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
// const SizedBox(height: 10),
],
),
),
);
},
);
}
void appointmentUpdateWindow(int index) {
void appointmentUpdateWindow(int index, double bodyWidth) {
showDialog(
context: context,
barrierDismissible: false,
@@ -405,14 +413,20 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
});
Navigator.of(context).pop();
},
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: widget.titleController,
@@ -443,8 +457,9 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
),
const SizedBox(height: 10),
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
fillColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: widget.descriptionIDController,
@@ -491,6 +506,7 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
),
],
),
),
);
},
);
@@ -624,7 +640,7 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
shrinkWrap: true,
itemCount: widget.appointmentList.length,
itemBuilder: (context, index) {
return displayAppointment(index);
return displayAppointment(index, width);
},
),
);

View File

@@ -99,7 +99,7 @@ class _PatientAccessRequestState extends State<Appointments> {
);
}
void addAppointmentWindow() {
void addAppointmentWindow(double width) {
showDialog(
context: context,
barrierDismissible: false,
@@ -114,14 +114,20 @@ class _PatientAccessRequestState extends State<Appointments> {
_appointmentTitleController.clear();
_appointmentDescriptionIDController.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,
@@ -152,8 +158,9 @@ class _PatientAccessRequestState extends State<Appointments> {
),
const SizedBox(height: 10),
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
fillColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: _appointmentDescriptionIDController,
@@ -173,8 +180,9 @@ class _PatientAccessRequestState extends State<Appointments> {
addAppointmentCall();
}
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
buttonColor: MzanziInnovationHub.of(context)!
.theme
.successColor(),
width: 300,
child: Text(
"Add",
@@ -192,6 +200,7 @@ class _PatientAccessRequestState extends State<Appointments> {
),
],
),
),
);
},
);
@@ -268,7 +277,7 @@ class _PatientAccessRequestState extends State<Appointments> {
});
}
Widget getBody() {
Widget getBody(double width) {
return Stack(
children: [
MihSingleChildScroll(
@@ -341,7 +350,7 @@ class _PatientAccessRequestState extends State<Appointments> {
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
addAppointmentWindow();
addAppointmentWindow(width);
},
)
],
@@ -383,9 +392,10 @@ class _PatientAccessRequestState extends State<Appointments> {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MihPackageToolBody(
borderOn: false,
bodyItem: getBody(),
bodyItem: getBody(screenWidth),
);
}
}