Redesign Access Package

This commit is contained in:
2025-03-11 10:54:44 +02:00
parent 3ec6b12a56
commit e2e4908980

View File

@@ -0,0 +1,68 @@
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih_app.dart';
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih_app_action.dart';
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih_app_tools.dart';
import 'package:Mzansi_Innovation_Hub/mih_objects/app_user.dart';
import 'package:Mzansi_Innovation_Hub/mih_packages/access_review/patient_access_review.dart';
import 'package:flutter/material.dart';
class MihAccess extends StatefulWidget {
final AppUser signedInUser;
const MihAccess({
super.key,
required this.signedInUser,
});
@override
State<MihAccess> createState() => _MihAccessState();
}
class _MihAccessState extends State<MihAccess> {
int _selcetedIndex = 0;
@override
Widget build(BuildContext context) {
return MihApp(
appActionButton: getAction(),
appTools: getTools(),
appBody: getToolBody(),
selectedbodyIndex: _selcetedIndex,
onIndexChange: (newValue) {
setState(() {
_selcetedIndex = newValue;
});
print("Index: $_selcetedIndex");
},
);
}
MihAppAction getAction() {
return MihAppAction(
icon: const Icon(Icons.arrow_back),
iconSize: 35,
onTap: () {
Navigator.of(context).pop();
},
);
}
MihAppTools getTools() {
Map<Widget, void Function()?> temp = {};
temp[const Icon(Icons.people)] = () {
setState(() {
_selcetedIndex = 0;
});
};
return MihAppTools(
tools: temp,
selcetedIndex: _selcetedIndex,
);
}
List<Widget> getToolBody() {
List<Widget> toolBodies = [
MihAccessRequest(
signedInUser: widget.signedInUser,
),
];
return toolBodies;
}
}