QOL: Mzansi Profile Package performance improvements

This commit is contained in:
2025-11-28 12:29:09 +02:00
parent 004c2397c5
commit a6fe4499d0
5 changed files with 54 additions and 28 deletions

View File

@@ -21,6 +21,8 @@ class MzansiProfile extends StatefulWidget {
class _MzansiProfileState extends State<MzansiProfile> {
bool _isLoadingInitialData = true;
late final MihPersonalProfile _personalProfile;
late final MihPersonalSettings _personalSettings;
Future<void> _loadInitialData() async {
setState(() {
@@ -39,6 +41,8 @@ class _MzansiProfileState extends State<MzansiProfile> {
@override
void initState() {
super.initState();
_personalProfile = const MihPersonalProfile();
_personalSettings = const MihPersonalSettings();
_loadInitialData();
}
@@ -100,11 +104,10 @@ class _MzansiProfileState extends State<MzansiProfile> {
}
List<Widget> getToolBody() {
List<Widget> toolBodies = [];
toolBodies.add(MihPersonalProfile());
// toolBodies.add(MihPersonalProfile());
toolBodies.add(MihPersonalSettings());
return toolBodies;
return [
_personalProfile,
_personalSettings,
];
}
List<String> getToolTitle() {

View File

@@ -16,6 +16,7 @@ class MzansiProfileView extends StatefulWidget {
class _MzansiProfileViewState extends State<MzansiProfileView> {
int _selcetedIndex = 0;
late final MihPersonalProfileView _personalProfileView;
@override
Widget build(BuildContext context) {
@@ -58,11 +59,9 @@ class _MzansiProfileViewState extends State<MzansiProfileView> {
}
List<Widget> getToolBody() {
List<Widget> toolBodies = [];
toolBodies.add(
MihPersonalProfileView(),
);
return toolBodies;
return [
_personalProfileView,
];
}
List<String> getToolTitle() {