button alignment

This commit is contained in:
2025-06-10 11:37:13 +02:00
parent 68bbfc3399
commit 67a84d52d9
2 changed files with 119 additions and 101 deletions

View File

@@ -280,7 +280,7 @@ class _BuildPatientsListState extends State<BuildMihPatientSearchList> {
visible: !hasAccess, visible: !hasAccess,
child: Column( child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
"Important Notice: Requesting Patient Profile Access", "Important Notice: Requesting Patient Profile Access",
@@ -343,111 +343,131 @@ class _BuildPatientsListState extends State<BuildMihPatientSearchList> {
), ),
), ),
// const SizedBox(height: 15.0), // const SizedBox(height: 15.0),
Wrap(runSpacing: 10, spacing: 10, children: [ Center(
Visibility( child: Wrap(
visible: hasAccess, alignment: WrapAlignment.center,
child: MihButton( crossAxisAlignment: WrapCrossAlignment.center,
onPressed: () { runSpacing: 10,
if (hasAccess) { spacing: 10,
Navigator.of(context) children: [
.pushNamed('/patient-manager/patient', Visibility(
arguments: PatientViewArguments( visible: hasAccess,
widget.signedInUser, child: Center(
widget.patients[index], child: MihButton(
widget.businessUser, onPressed: () {
widget.business, if (hasAccess) {
"business", Navigator.of(context)
)); .pushNamed('/patient-manager/patient',
} else { arguments: PatientViewArguments(
noAccessWarning(); widget.signedInUser,
} widget.patients[index],
}, widget.businessUser,
buttonColor: widget.business,
MzanziInnovationHub.of(context)!.theme.successColor(), "business",
width: 300, ));
child: Text( } else {
"View Profile", noAccessWarning();
style: TextStyle( }
color: },
MzanziInnovationHub.of(context)!.theme.primaryColor(), buttonColor: MzanziInnovationHub.of(context)!
fontSize: 20, .theme
fontWeight: FontWeight.bold, .successColor(),
), width: 300,
), child: Text(
), "View Profile",
), style: TextStyle(
Visibility( color: MzanziInnovationHub.of(context)!
visible: !hasAccess && accessStatus == "No Access", .theme
child: MihButton( .primaryColor(),
onPressed: () { fontSize: 20,
MIHApiCalls.addPatientAccessAPICall( fontWeight: FontWeight.bold,
widget.business!.business_id, ),
widget.patients[index].app_id, ),
"patient",
widget.business!.Name,
widget.personalSelected,
BusinessArguments(
widget.signedInUser,
widget.businessUser,
widget.business,
), ),
context,
);
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
width: 300,
child: Text(
"Request Access",
style: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
), ),
), ),
), Visibility(
), visible: !hasAccess && accessStatus == "No Access",
Visibility( child: Center(
visible: !hasAccess && accessStatus == "declined", child: MihButton(
child: MihButton( onPressed: () {
onPressed: () { MIHApiCalls.addPatientAccessAPICall(
MIHApiCalls.reapplyPatientAccessAPICall( widget.business!.business_id,
widget.business!.business_id, widget.patients[index].app_id,
widget.patients[index].app_id, "patient",
widget.personalSelected, widget.business!.Name,
BusinessArguments( widget.personalSelected,
widget.signedInUser, BusinessArguments(
widget.businessUser, widget.signedInUser,
widget.business, widget.businessUser,
widget.business,
),
context,
);
},
buttonColor: MzanziInnovationHub.of(context)!
.theme
.successColor(),
width: 300,
child: Text(
"Request Access",
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
), ),
context,
);
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 300,
child: Text(
"Re-apply",
style: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
), ),
), ),
), Visibility(
visible: !hasAccess && accessStatus == "declined",
child: Center(
child: MihButton(
onPressed: () {
MIHApiCalls.reapplyPatientAccessAPICall(
widget.business!.business_id,
widget.patients[index].app_id,
widget.personalSelected,
BusinessArguments(
widget.signedInUser,
widget.businessUser,
widget.business,
),
context,
);
},
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
width: 300,
child: Text(
"Re-apply",
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
),
Visibility(
visible: !hasAccess && accessStatus == "pending",
child: const SizedBox(
width: 500,
//height: 50,
child: Text(
"Patient has not approved access to their profile. Once access has been approved you can book and appointment or view their profile."),
),
),
],
), ),
Visibility( ),
visible: !hasAccess && accessStatus == "pending",
child: const SizedBox(
width: 500,
//height: 50,
child: Text(
"Patient has not approved access to their profile. Once access has been approved you can book and appointment or view their profile."),
),
),
])
], ],
), ),
), ),

View File

@@ -12,7 +12,6 @@ import 'package:mzansi_innovation_hub/mih_objects/patient_access.dart';
import 'package:mzansi_innovation_hub/mih_objects/patients.dart'; import 'package:mzansi_innovation_hub/mih_objects/patients.dart';
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_manager/list_builders/build_mih_patient_search_list.dart'; import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_manager/list_builders/build_mih_patient_search_list.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class MihPatientSearch extends StatefulWidget { class MihPatientSearch extends StatefulWidget {
final AppUser signedInUser; final AppUser signedInUser;
@@ -188,7 +187,6 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
@override @override
void dispose() { void dispose() {
// TODO: implement dispose
super.dispose(); super.dispose();
_searchFocusNode.dispose(); _searchFocusNode.dispose();
_mihPatientSearchController.dispose(); _mihPatientSearchController.dispose();