Mih File Structure enhancement

This commit is contained in:
2025-11-18 12:42:22 +02:00
parent f5c05d7431
commit b69a52a5a8
294 changed files with 2782 additions and 4473 deletions

View File

@@ -0,0 +1,37 @@
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/mih_objects/patient_access.dart';
class MihAccessControllsProvider extends ChangeNotifier {
int toolIndex;
List<PatientAccess>? accessList;
MihAccessControllsProvider({
this.toolIndex = 0,
});
void reset() {
toolIndex = 0;
accessList = null;
notifyListeners();
}
void setToolIndex(int index) {
toolIndex = index;
}
void setAccessList(List<PatientAccess> accesses) {
accessList = accesses;
notifyListeners();
}
void editAccessItem(PatientAccess updatedAccess) {
if (accessList == null) return;
int index = accessList!.indexWhere((access) =>
access.app_id == updatedAccess.app_id &&
access.business_id == updatedAccess.business_id);
if (index != -1) {
accessList![index] = updatedAccess;
notifyListeners();
}
}
}