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

@@ -99,7 +99,7 @@ class _PatientAccessRequestState extends State<Appointments> {
);
}
void addAppointmentWindow() {
void addAppointmentWindow(double width) {
showDialog(
context: context,
barrierDismissible: false,
@@ -114,83 +114,92 @@ class _PatientAccessRequestState extends State<Appointments> {
_appointmentTitleController.clear();
_appointmentDescriptionIDController.clear();
},
windowBody: Column(
children: [
MihForm(
formKey: _formKey,
formFields: [
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: _appointmentTitleController,
multiLineInput: false,
requiredText: true,
hintText: "Appointment Title",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
const SizedBox(height: 10),
SizedBox(
// width: 500,
child: MIHDateField(
controller: _appointmentDateController,
lableText: "Date",
required: true,
),
),
const SizedBox(height: 10),
SizedBox(
// width: 500,
child: MIHTimeField(
controller: _appointmentTimeController,
lableText: "Time",
required: true,
),
),
const SizedBox(height: 10),
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: _appointmentDescriptionIDController,
multiLineInput: true,
height: 250,
requiredText: true,
hintText: "Appointment Description",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
const SizedBox(height: 20),
Center(
child: MihButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
addAppointmentCall();
}
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(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: _appointmentTitleController,
multiLineInput: false,
requiredText: true,
hintText: "Appointment Title",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
width: 300,
child: Text(
"Add",
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
const SizedBox(height: 10),
SizedBox(
// width: 500,
child: MIHDateField(
controller: _appointmentDateController,
lableText: "Date",
required: true,
),
),
const SizedBox(height: 10),
SizedBox(
// width: 500,
child: MIHTimeField(
controller: _appointmentTimeController,
lableText: "Time",
required: true,
),
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: _appointmentDescriptionIDController,
multiLineInput: true,
height: 250,
requiredText: true,
hintText: "Appointment Description",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
const SizedBox(height: 20),
Center(
child: MihButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
addAppointmentCall();
}
},
buttonColor: MzanziInnovationHub.of(context)!
.theme
.successColor(),
width: 300,
child: Text(
"Add",
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
),
],
),
],
],
),
],
),
),
);
},
@@ -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),
);
}
}