add scrolling

This commit is contained in:
2025-03-11 11:06:01 +02:00
parent 02dc125b0a
commit 21b6154239

View File

@@ -127,96 +127,99 @@ class _MihAccessRequestState extends State<MihAccessRequest> {
} }
Widget getBody() { Widget getBody() {
return Column( return SingleChildScrollView(
children: [ child: Column(
const Text( children: [
"Access List", const Text(
style: TextStyle( "Access List",
fontWeight: FontWeight.bold, style: TextStyle(
fontSize: 25, fontWeight: FontWeight.bold,
fontSize: 25,
),
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), Row(
Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, children: [
children: [ Flexible(
Flexible( child: MIHDropdownField(
child: MIHDropdownField( controller: filterController,
controller: filterController, hintText: "Access Types",
hintText: "Access Types", dropdownOptions: const [
dropdownOptions: const [ "All",
"All", "Approved",
"Approved", "Pending",
"Pending", "Declined",
"Declined", "Cancelled"
"Cancelled" ],
], required: true,
required: true, editable: true,
editable: true, enableSearch: false,
enableSearch: false, ),
), ),
), IconButton(
IconButton( onPressed: () {
onPressed: () { setState(() {
setState(() { forceRefresh = true;
forceRefresh = true; });
}); refreshList();
refreshList(); },
}, icon: const Icon(
icon: const Icon( Icons.refresh,
Icons.refresh, ),
), ),
), ],
], ),
), const SizedBox(height: 10),
const SizedBox(height: 10), FutureBuilder(
FutureBuilder( future: accessList,
future: accessList, builder: (context, snapshot) {
builder: (context, snapshot) { //print("patient Queue List ${snapshot.hasData}");
//print("patient Queue List ${snapshot.hasData}"); if (snapshot.connectionState == ConnectionState.waiting) {
if (snapshot.connectionState == ConnectionState.waiting) { return const Mihloadingcircle();
return const Mihloadingcircle(); } else if (snapshot.connectionState == ConnectionState.done) {
} else if (snapshot.connectionState == ConnectionState.done) { List<PatientAccess> accessRequestList;
List<PatientAccess> accessRequestList; accessRequestList = filterSearchResults(snapshot.requireData);
accessRequestList = filterSearchResults(snapshot.requireData); if (accessRequestList.isNotEmpty) {
if (accessRequestList.isNotEmpty) { return BuildBusinessAccessList(
return BuildBusinessAccessList( signedInUser: widget.signedInUser,
signedInUser: widget.signedInUser, patientAccessList: accessRequestList,
patientAccessList: accessRequestList, );
); } else {
return Center(
child: Text(
"No Request have been made.",
style: TextStyle(
fontSize: 25,
color: MzanziInnovationHub.of(context)!
.theme
.messageTextColor()),
textAlign: TextAlign.center,
),
);
}
// return Expanded(
// child: displayAccessRequestList(accessRequestList),
// );
} else { } else {
return Center( return Center(
child: Text( child: Text(
"No Request have been made.", "$errorCode: Error pulling Patients Data\n$baseUrl/queue/patients/\n$errorBody",
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 25,
color: MzanziInnovationHub.of(context)! color: MzanziInnovationHub.of(context)!
.theme .theme
.messageTextColor()), .errorColor()),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
); );
} }
},
// return Expanded( ),
// child: displayAccessRequestList(accessRequestList), ],
// ); ),
} else {
return Center(
child: Text(
"$errorCode: Error pulling Patients Data\n$baseUrl/queue/patients/\n$errorBody",
style: TextStyle(
fontSize: 25,
color:
MzanziInnovationHub.of(context)!.theme.errorColor()),
textAlign: TextAlign.center,
),
);
}
},
),
],
); );
} }